Re: [ck] Swap prefetch tester

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/14/07, Con Kolivas <[email protected]> wrote:
On Monday 14 May 2007 12:10, Con Kolivas wrote:
> I've had a few requests for a standalone patch implementing swap prefetch
> for mainline.
>
> Here is a patch that is a current rollup that should apply and work for
> vanilla 2.6.21 (ie not a -ck kernel):
>
> http://ck.kolivas.org/patches/swap-prefetch/2.6.21-swap_prefetch-38.patch

Oh and here is the swap prefetch tester:
http://ck.kolivas.org/patches/swap-prefetch/sp_tester.c

Some results on my 5-year-old dual AMD2400+ with 1GB mem:
***This one done while in X, 2.6.21.1-reiser4-ck1, sp ON
Ram 1034228000  Swap 1959920000
Total ram to be malloced: 1551342000 bytes
Starting first malloc of 775671000 bytes
Starting 1st read of first malloc
Touching this much ram takes 6333 milliseconds
Starting second malloc of 775671000 bytes
Completed second malloc and free
Sleeping for 600 seconds
Important part - starting reread of first malloc
Completed read of first malloc
Timed portion 103277 milliseconds

***This one done while in X, 2.6.21.1-reiser4-ck-sp38, sp ON
Ram 1034228000  Swap 1959920000
Total ram to be malloced: 1551342000 bytes
Starting first malloc of 775671000 bytes
Starting 1st read of first malloc
Touching this much ram takes 11674 milliseconds
Starting second malloc of 775671000 bytes
Completed second malloc and free
Sleeping for 600 seconds
Important part - starting reread of first malloc
Completed read of first malloc
Timed portion 24660 milliseconds

...a nice order of magnitude better! Very happy you fixed this Con.
But the time to touch was so different (11674 vs 6333ms) that I
decided to get out of X, and also check the difference when SP is off.
# ./sp_tester; echo 0 > /proc/sys/vm/swap_prefetch ; ./sp_tester


***This one done in the console at runlevel 2, 2.6.21.1-reiser4-ck-sp38, sp ON
Ram 1034228000  Swap 1959920000
Total ram to be malloced: 1551342000 bytes
Starting first malloc of 775671000 bytes
Starting 1st read of first malloc
Touching this much ram takes 5709 milliseconds
Starting second malloc of 775671000 bytes
Completed second malloc and free
Sleeping for 600 seconds
Important part - starting reread of first malloc
Completed read of first malloc
Timed portion 22243 milliseconds

***This one done in the console at runlevel 2, 2.6.21.1-reiser4-ck-sp38, sp OFF
Ram 1034228000  Swap 1959920000
Total ram to be malloced: 1551342000 bytes
Starting first malloc of 775671000 bytes
Starting 1st read of first malloc
Touching this much ram takes 5816 milliseconds
Starting second malloc of 775671000 bytes
Completed second malloc and free
Sleeping for 600 seconds
Important part - starting reread of first malloc
Completed read of first malloc
Timed portion 28641 milliseconds

Have I understood correctly that there are more prefetch improvements
in ck2 than just the sp38 patch?

I'll post more results if I ever manage to tear myself from the
computer for 10 minutes when I'm home - it looks like I have a yiff
daemon running at 7% cpu all the time which might have affected the
results.

Speaking of "feel", the net effect of swap prefetch for me seems to be
that I don't notice it - that is, I don't notice my programs behaving
sluggishly when I come back to the computer. Excellent!

-K
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux