All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Christoph Lameter <clameter@engr.sgi.com>
Cc: nickpiggin@yahoo.com.au, akpm@osdl.org, linux-mm@kvack.org
Subject: Re: Get rid of scan_control
Date: Fri, 10 Feb 2006 22:53:55 -0600	[thread overview]
Message-ID: <20060211045355.GA3318@dmt.cnet> (raw)
In-Reply-To: <Pine.LNX.4.62.0602092039230.13184@schroedinger.engr.sgi.com>

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.

> 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?

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.

At first, my opinion is that the possible benefits for performance do
not outweight the readability and expandability advantages it provides.

--
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>

  reply	other threads:[~2006-02-11  4:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-10  5:02 Get rid of scan_control Christoph Lameter
2006-02-11  4:53 ` Marcelo Tosatti [this message]
2006-02-11  9:32   ` Andrew Morton
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=20060211045355.GA3318@dmt.cnet \
    --to=marcelo.tosatti@cyclades.com \
    --cc=akpm@osdl.org \
    --cc=clameter@engr.sgi.com \
    --cc=linux-mm@kvack.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.