Skip to content

Commit a50d3d3

Browse files
danglin44hdeller
authored andcommitted
parisc: Rewrite tlb flush threshold calculation
Signed-off-by: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 53a42b6 commit a50d3d3

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

‎arch/parisc/kernel/cache.c‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,12 @@ EXPORT_SYMBOL(flush_kernel_icache_range_asm);
383383
static unsigned long parisc_cache_flush_threshold __ro_after_init = FLUSH_THRESHOLD;
384384

385385
#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;
387387

388388
void __init parisc_setup_cache_timing(void)
389389
{
390390
unsigned long rangetime, alltime;
391-
unsigned long size, start;
391+
unsigned long size;
392392
unsigned long threshold;
393393

394394
alltime = mfctl(16);
@@ -422,14 +422,9 @@ void __init parisc_setup_cache_timing(void)
422422
goto set_tlb_threshold;
423423
}
424424

425-
size = 0;
426-
start = (unsigned long) _text;
425+
size = (unsigned long)_end - (unsigned long)_text;
427426
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);
433428
rangetime = mfctl(16) - rangetime;
434429

435430
alltime = mfctl(16);
@@ -444,8 +439,11 @@ void __init parisc_setup_cache_timing(void)
444439
threshold/1024);
445440

446441
set_tlb_threshold:
447-
if (threshold > parisc_tlb_flush_threshold)
442+
if (threshold > FLUSH_TLB_THRESHOLD)
448443
parisc_tlb_flush_threshold = threshold;
444+
else
445+
parisc_tlb_flush_threshold = FLUSH_TLB_THRESHOLD;
446+
449447
printk(KERN_INFO "TLB flush threshold set to %lu KiB\n",
450448
parisc_tlb_flush_threshold/1024);
451449
}

0 commit comments

Comments
 (0)