Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

parisc: Rewrite tlb flush threshold calculation

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

John David Anglin and committed by
Helge Deller
a50d3d3c 53a42b63

+8 -10
+8 -10
arch/parisc/kernel/cache.c
··· 383 383 static unsigned long parisc_cache_flush_threshold __ro_after_init = FLUSH_THRESHOLD; 384 384 385 385 #define FLUSH_TLB_THRESHOLD (16*1024) /* 16 KiB minimum TLB threshold */ 386 - static unsigned long parisc_tlb_flush_threshold __ro_after_init = FLUSH_TLB_THRESHOLD; 386 + static unsigned long parisc_tlb_flush_threshold __ro_after_init = ~0UL; 387 387 388 388 void __init parisc_setup_cache_timing(void) 389 389 { 390 390 unsigned long rangetime, alltime; 391 - unsigned long size, start; 391 + unsigned long size; 392 392 unsigned long threshold; 393 393 394 394 alltime = mfctl(16); ··· 422 422 goto set_tlb_threshold; 423 423 } 424 424 425 - size = 0; 426 - start = (unsigned long) _text; 425 + size = (unsigned long)_end - (unsigned long)_text; 427 426 rangetime = mfctl(16); 428 - while (start < (unsigned long) _end) { 429 - flush_tlb_kernel_range(start, start + PAGE_SIZE); 430 - start += PAGE_SIZE; 431 - size += PAGE_SIZE; 432 - } 427 + flush_tlb_kernel_range((unsigned long)_text, (unsigned long)_end); 433 428 rangetime = mfctl(16) - rangetime; 434 429 435 430 alltime = mfctl(16); ··· 439 444 threshold/1024); 440 445 441 446 set_tlb_threshold: 442 - if (threshold > parisc_tlb_flush_threshold) 447 + if (threshold > FLUSH_TLB_THRESHOLD) 443 448 parisc_tlb_flush_threshold = threshold; 449 + else 450 + parisc_tlb_flush_threshold = FLUSH_TLB_THRESHOLD; 451 + 444 452 printk(KERN_INFO "TLB flush threshold set to %lu KiB\n", 445 453 parisc_tlb_flush_threshold/1024); 446 454 }