public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Cc: linux-kernel@vger.kernel.org, ck@vds.kolivas.org
Subject: Re: [PATCH] vm - swap_prefetch-15
Date: Fri, 7 Oct 2005 22:18:57 +1000	[thread overview]
Message-ID: <200510072218.57864.kernel@kolivas.org> (raw)
In-Reply-To: <4d8e3fd30510070446gb6d469bn4502b30d1e14c7e8@mail.gmail.com>

On Fri, 7 Oct 2005 21:46, Paolo Ciarrocchi wrote:
> On 10/6/05, Con Kolivas <kernel@kolivas.org> wrote:
> > The last known bugs were addressed in this latest version of the swap
> > prefetching patch. Thanks to the testers out there who helped it get this
> > far.
> >
> > -Prefetched pages weren't handled properly by the lru lists.
> > -Prefetch groups are now 10 times larger when laptop_mode is enabled thus
> > decreasing the amount of time spent prefetching and thus the disk
> > spinning. -Documentation as suggested by Ingo Oeser
> >
> > Incremental patches and latest available here:
> > http://ck.kolivas.org/patches/swap-prefetch/
>
> Ciao Con,
> i downloading right now kernel 2.6.14-rc3 and your latest patch (v15),
> in the weekend I'll update my Ubuntu platform and I'll like to compare
> performance of vanilla vs vm-swap_prefetch.

Great!

> Any hint about what kind of instrumentation I could use in order to
> get interesting and useful numbers ?

To get some useful advantage from it you have to have a workload that swaps on 
your hardware in the first place. I have a simple mechanism to induce it 
reliably where I open a few large applications concurrently - browser and 
office suite come to mind, then create my swap load:

tail -f /dev/zero

works real nice. Either let it run to completion and hope that tail gets 
oom-killed or ctrl-c it after you've used up half your swapspace.
Then I usually let vmstat 1 run in the background. Leave the machine for 5 or 
10 minutes and do simple wallclock time from the moment you click on the 
application till it is available. Try changing swap_prefetch from 2 to 0 
in /proc/sys/vm/swap_prefetch to compare the difference. This is a very 
coarse and somewhat contrived example, but even in real world settings where 
you hit swapspace during normal usage it is slowly trickling in in the 
background and I find it makes a noticeable difference.

If you watch vmstat with swap_prefetch enabled, you'll notice it doing SI of 
256KB (at default setting of swap_prefetch==2) every second when the machine 
is very idle. Then after all the pages have been prefetched, when you click 
on the application you shouldn't see anything in SI at all implying no swap 
in. You can see how many entries are currently in the prefetch swaplist 
easily enough with
cat /proc/slabinfo | grep swapped_entry

where the first numeric column of active objects shows the number of pages in 
the list (not all of them will result in a swapped in page).

Cheers,
Con

      reply	other threads:[~2005-10-07 12:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-06 14:01 [PATCH] vm - swap_prefetch-15 Con Kolivas
2005-10-06 14:13 ` [PATCH] vm - swap_prefetch-15 docs Con Kolivas
2005-10-07 10:03 ` [PATCH] vm - swap_prefetch-15 Pekka Enberg
2005-10-07 10:54   ` Con Kolivas
2005-10-07 11:31     ` Pekka Enberg
2005-10-07 12:08       ` Con Kolivas
2005-10-07 12:26         ` Pekka J Enberg
2005-10-07 12:33           ` Con Kolivas
2005-10-07 12:49             ` Pekka J Enberg
2005-10-07 14:44       ` [ck] " Gustavo Barbieri
2005-10-07 18:28         ` Rudo Thomas
2005-10-07 18:40           ` Gustavo Barbieri
2005-10-07 11:46 ` Paolo Ciarrocchi
2005-10-07 12:18   ` Con Kolivas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200510072218.57864.kernel@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=ck@vds.kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paolo.ciarrocchi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox