From: Andrew Morton <akpm@osdl.org>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: clameter@engr.sgi.com, nickpiggin@yahoo.com.au, linux-mm@kvack.org
Subject: Re: Get rid of scan_control
Date: Sat, 11 Feb 2006 01:32:55 -0800 [thread overview]
Message-ID: <20060211013255.20832152.akpm@osdl.org> (raw)
In-Reply-To: <20060211045355.GA3318@dmt.cnet>
Marcelo Tosatti <marcelo.tosatti@cyclades.com> wrote:
>
>
> Hi Christoph,
>
> On Thu, Feb 09, 2006 at 09:02:00PM -0800, Christoph Lameter wrote:
> > This is done through a variety of measures:
> >
> > 1. nr_reclaimed is the return value of functions and each function
> > does the summing of the reclaimed pages on its own.
> >
> > 2. nr_scanned is passed as a reference parameter (sigh... the only leftover)
> >
> > 3. nr_mapped is calculated on each invocation of refill_inactive_list.
> > This is not that optimal but then swapping is not that performance
> > critical.
>
> But refill_inactive_list() is not used for swapping only. All evicted
> pages go through that path - it can be _very_ hot.
A bit hot. I guess it's worth fixing.
> > 4. gfp_mask is passed as a parameter. OR flags to gfp_mask for may_swap
> > and may_writepage.
> >
> > 5. Pass swap_cluster_max as a parameter
> >
> > Most of the parameters passed through scan_control become local variables.
> > Therefore the compilers are able to generate better code.
> >
> > And we do no longer have the problem of initializing scan control the
> > right way.
>
> I don't think its worth doing that - do you have any performance
> measurement and analysis of the generated code? Is the current code a
> bottleneck for any of your applications?
This patch isn't a performance thing. I found that scan_control wasn't
really a success. We had one bug due to failing to initialise something in
it, and we're fiddling with fields all over the place. It just seemed to
obfuscate the code, make it harder to work with, harder to check that
everything was correct.
Kind of like global variables, really.
> One very nice thing about "scan_control" is that it aggregates all
> parameters related to reclaim procedure instances, making the code
> much clearer, easier to understand, and elegant. Moreover it allows
> expandability: new parameters can be contained within the structure.
Well yes, it allows for expansion. But my experience was the exact
opposite of what you're saying.
scan_control was modelled on writeback_control. But writeback_control
works, and scan_control doesn't. I think this is because a)
writeback_control instances are always initialised at the declaration site
and b) writeback_control is just a lot simpler.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2006-02-11 9:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-10 5:02 Christoph Lameter
2006-02-11 4:53 ` Marcelo Tosatti
2006-02-11 9:32 ` Andrew Morton [this message]
2006-02-11 9:46 ` Andrew Morton
2006-02-12 3:33 ` Nick Piggin
2006-02-12 3:47 ` Christoph Lameter
2006-02-12 4:08 ` Nick Piggin
2006-02-12 4:41 ` Christoph Lameter
2006-02-12 5:01 ` Nick Piggin
2006-02-12 5:14 ` Andrew Morton
2006-02-12 5:37 ` Andrew Morton
2006-02-12 6:49 ` Christoph Lameter
2006-02-12 7:53 ` Andrew Morton
2006-02-13 17:54 ` Christoph Lameter
2006-02-12 6:25 ` Christoph Lameter
2006-02-11 19:01 ` Christoph Lameter
2006-02-11 21:13 ` Andrew Morton
2006-02-11 21:27 ` Christoph Lameter
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=20060211013255.20832152.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=clameter@engr.sgi.com \
--cc=linux-mm@kvack.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