From: Shantanu Goel <sgoel01@yahoo.com>
To: Antonio Vargas <wind@cocodriloo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [VM PATCH] Faster reclamation of dirty pages and unused inode/dcache entries in 2.4.22
Date: Fri, 29 Aug 2003 10:55:44 -0700 (PDT) [thread overview]
Message-ID: <20030829175544.84979.qmail@web12803.mail.yahoo.com> (raw)
In-Reply-To: <20030829145749.GA709@wind.cocodriloo.com>
I am not very knowledgeable about micro-optimizations.
I'll take your word for it. ;-) What interests me
more is whether others notice any performance
improvement under swapout with this patch given that
is on the order of milliseconds.
--- Antonio Vargas <wind@cocodriloo.com> wrote:
> On Fri, Aug 29, 2003 at 08:01:11AM -0700, Shantanu
> Goel wrote:
> > Hi kernel hackers,
> >
> > The VM subsystem in Linux 2.4.22 can cause
> spurious
> > swapouts in the presence of lots of dirty pages.
> > Presently, as dirty pages are encountered,
> > shrink_cache() schedules a writepage() and moves
> the
> > page to the head of the inactive list. When a lot
> of
> > dirty pages are present, this can break the FIFO
> > ordering of the inactive list because clean pages
> > further down the list will be reclaimed first.
> The
> > following patch records the pages being laundered,
> and
> > once SWAP_CLUSTER_MAX pages have been accumulated
> or
> > the scan is complete, goes back and attempts to
> move
> > them back to the tail of the list.
> >
> > The second part of the patch reclaims unused
> > inode/dentry/dquot entries more aggressively. I
> have
> > observed that on an NFS server where swap out
> activity
> > is low, the VM can shrink the page cache to the
> point
> > where most pages are used up by unused
> inode/dentry
> > entries. This is because page cache reclamation
> > succeeds most of the time except when a swap_out()
> > happens.
> >
> > Feedback and comments are welcome.
>
> Microoptimization (which helps on x86 a lot):
>
> - for (i = nr_pages - 1; i >= 0; i--) {
> - page = laundry[i];
> + laundry += nr_pages;
> + for (i = -nr_pages; ++i ;){
> + page = laundry[i];
>
> Your original code reads from higher to lower
> addresses,
> while the new one reads from lower to higer
> addresses.
>
> The new code changes and then tests the loop
> counter,
> so it's a little bit faster :)
>
> Both check against zero, so both can use result
> flags
> directly and do no intervening "cmp ecx,CONSTANT".
>
> To the "powers that be", would this type of
> microoptimizations
> be futher welcomed?
>
> Greets, Antonio.
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
next prev parent reply other threads:[~2003-08-29 17:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-29 15:01 [VM PATCH] Faster reclamation of dirty pages and unused inode/dcache entries in 2.4.22 Shantanu Goel
2003-08-29 14:57 ` Antonio Vargas
2003-08-29 17:55 ` Shantanu Goel [this message]
2003-08-29 18:06 ` Mike Fedyk
2003-08-29 18:46 ` Shantanu Goel
2003-08-29 18:57 ` Mike Fedyk
2003-08-29 19:28 ` Andrea Arcangeli
2003-08-29 19:46 ` Shantanu Goel
2003-08-29 19:55 ` Andrea Arcangeli
2003-08-29 20:20 ` Shantanu Goel
2003-08-30 5:01 ` Antonio Vargas
2003-09-20 13:39 ` A couple of 2.4.23-pre4 VM nits Shantanu Goel
2003-09-21 2:46 ` Andrea Arcangeli
2003-09-21 5:32 ` Shantanu Goel
2003-09-21 14:04 ` Andrea Arcangeli
2003-09-21 14:51 ` Shantanu Goel
2003-09-21 15:14 ` Andrea Arcangeli
2003-09-21 15:28 ` Shantanu Goel
2003-09-21 15:57 ` Andrea Arcangeli
2003-09-21 18:37 ` Marcelo Tosatti
2003-08-29 19:11 ` [VM PATCH] Faster reclamation of dirty pages and unused inode/dcache entries in 2.4.22 Rahul Karnik
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=20030829175544.84979.qmail@web12803.mail.yahoo.com \
--to=sgoel01@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wind@cocodriloo.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;
as well as URLs for NNTP newsgroup(s).