public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: 76306.1226@compuserve.com, linux-kernel@vger.kernel.org,
	nickpiggin@yahoo.com.au
Subject: Re: balance_pgdat(): where is total_scanned ever updated?
Date: Tue, 9 Nov 2004 13:40:32 -0800	[thread overview]
Message-ID: <20041109134032.124b55fa.akpm@osdl.org> (raw)
In-Reply-To: <20041109180223.GG7632@logos.cnet>

> > > > I had a patch which fixes it in -mm for a while.  It does increase the
> > > > number of pages which are reclaimed via direct reclaim and decreases the
> > > > number of pages which are reclaimed by kswapd.  As one would expect from
> > > > throttling kswapd.  This seems undesirable.
> > > 
> > > Hi Andrew,
> > > 
> > > Do you have any numbers to backup the claim "It does increase the
> > > number of pages which are reclaimed via direct reclaim and decreases the
> > > number of pages which are reclaimed by kswapd", please?
> > 
> > Run a workload and watch /proc/vmstat.  iirc, the one-line total_scanned
> > fix takes the kswapd-vs-direct reclaim rate from 1:1 to 1:3 or thereabouts.
> 
> You're talking about laptop_mode ONLY, then?

No, not at all.

If we restore the total_scanned logic then kswapd will throttle itself, as
designed.  Regardless of laptop_mode.  I did that, and monitored the page
scanning and reclaim rates under various workloads.  I observed that with
the fix in place, kswapd performed less page reclaim and direct-reclaim
performed more reclaim.  And I wasn't able to demonstrate any benchmark
improvements with the fix in place, so things are left as they are.

> How can that have any effect if may_writepage is ignored if !laptop_mode? 

This is to do with kswapd throttling.  If we put kswapd to sleep more
often, it does less scanning and reclaiming.

> About /proc/vmstat - each output is huge - do you actually read those?

yup.

	cat /proc/vmstat > /tmp/1
	run workload
	cat /proc/vmstat > /tmp/2
	analyse /tmp/1 and /tmp/2

> We need a vmstat like tool for that information to be readable.

Would be nice.

> > > Because linux-2.6.10-rc1-mm2 (and 2.6.9) completly ignores sc->may_writepage 
> > > under normal operation, its only used when laptop_mode is on:
> > > 
> > > 		if (laptop_mode && !sc->may_writepage)
> > > 			goto keep_locked;
> > > 
> > > Is this intentional ???
> > 
> > yup.  In laptop mode we try to scan further to find a clean page rather
> > than spinning up the disk for a writepage.
> 
> It might be interesting to use sc->may_writepage independantly of
> laptop mode (ie make kswapd only writeout pages if the reclaim ratio 
> is low).

sure.


  reply	other threads:[~2004-11-09 21:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-06 19:15 balance_pgdat(): where is total_scanned ever updated? Chuck Ebbert
2004-11-07  0:11 ` Andrew Morton
2004-11-09 10:42   ` Marcelo Tosatti
2004-11-09 19:36     ` Andrew Morton
2004-11-09 18:02       ` Marcelo Tosatti
2004-11-09 21:40         ` Andrew Morton [this message]
2004-11-09 18:52           ` Marcelo Tosatti
2004-11-09 22:40             ` Andrew Morton
2004-11-10 13:24             ` Nikita Danilov
  -- strict thread matches above, loose matches on Subject: below --
2004-11-07  5:02 Chuck Ebbert
2004-11-10  3:34 Chuck Ebbert

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=20041109134032.124b55fa.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=76306.1226@compuserve.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    --cc=nickpiggin@yahoo.com.au \
    /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