Skip to content

Commit a58e9d0

Browse files
danglin44hdeller
authored andcommitted
parisc: Increase parisc_cache_flush_threshold setting
In testing the "Fix non-access data TLB cache flush faults" change, I noticed a significant improvement in glibc build and check times. This led me to investigate the parisc_cache_flush_threshold setting. It determines when we switch from line flushing to whole cache flushing. It turned out that the parisc_cache_flush_threshold setting on mako and mako2 machines (PA8800 and PA8900 processors) was way too small. Adjusting this setting provided almost a factor two improvement in the glibc build and check time. Signed-off-by: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent e5e9e7f commit a58e9d0

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

arch/parisc/kernel/cache.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ void __init parisc_setup_cache_timing(void)
388388
{
389389
unsigned long rangetime, alltime;
390390
unsigned long size;
391-
unsigned long threshold;
391+
unsigned long threshold, threshold2;
392392

393393
alltime = mfctl(16);
394394
flush_data_cache();
@@ -403,8 +403,20 @@ void __init parisc_setup_cache_timing(void)
403403
alltime, size, rangetime);
404404

405405
threshold = L1_CACHE_ALIGN(size * alltime / rangetime);
406-
if (threshold > cache_info.dc_size)
407-
threshold = cache_info.dc_size;
406+
407+
/*
408+
* The threshold computed above isn't very reliable since the
409+
* flush times depend greatly on the percentage of dirty lines
410+
* in the flush range. Further, the whole cache time doesn't
411+
* include the time to refill lines that aren't in the mm/vma
412+
* being flushed. By timing glibc build and checks on mako cpus,
413+
* the following formula seems to work reasonably well. The
414+
* value from the timing calculation is too small, and increases
415+
* build and check times by almost a factor two.
416+
*/
417+
threshold2 = cache_info.dc_size * num_online_cpus();
418+
if (threshold2 > threshold)
419+
threshold = threshold2;
408420
if (threshold)
409421
parisc_cache_flush_threshold = threshold;
410422
printk(KERN_INFO "Cache flush threshold set to %lu KiB\n",

0 commit comments

Comments
 (0)