From: Andrew Morton <akpm@linux-foundation.org>
To: Michel Lespinasse <walken@google.com>
Cc: Ying Han <yinghan@google.com>, Nick Piggin <npiggin@kernel.dk>,
Mel Gorman <mel@csn.ul.ie>, Minchan Kim <minchan.kim@gmail.com>,
Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>,
Nick Piggin <npiggin@gmail.com>,
linux-mm@kvack.org, Wu Fengguang <fengguang.wu@intel.com>
Subject: Re: [PATCH] Pass priority to shrink_slab
Date: Mon, 22 Nov 2010 18:26:27 -0800 [thread overview]
Message-ID: <20101122182627.11677116.akpm@linux-foundation.org> (raw)
In-Reply-To: <AANLkTik6XxhGn=ASmyhxbq6wuCGtUaiW6s8rZBTQUu8_@mail.gmail.com>
On Mon, 22 Nov 2010 18:09:33 -0800 Michel Lespinasse <walken@google.com> wrote:
> On Mon, Nov 22, 2010 at 3:06 PM, Andrew Morton
> <akpm@linux-foundation.org> wrote:
> > On Fri, 19 Nov 2010 19:23:22 -0800
> > Ying Han <yinghan@google.com> wrote:
> >> Yes, and it would be much easier later to add a small feature (like this
> >> one) w/o
> >> touching so many files of the shrinkers. I am thinking if we can extend the
> >> scan_control
> >> from page reclaim and pass it down to the shrinker ?
> >
> > Yes, that might work. __All callers of shrink_slab() already have a
> > scan_control on the stack, so passing all that extra info to the
> > shrinkers (along with some extra fields if needed) is pretty cheap, and
> > I don't see a great downside to exposing unneeded fields to the
> > shrinkers, given they're already on the stack somewhere.
>
> The only downside I can see is that it makes struct scan_control
> public - it'll need to be declared in a public header file so that all
> shrinkers can access it.
We've done worse things ;) Put it in scan_control.h and it will only be
exposed to code which has a legitimate need for it.
> Maybe one way to mitigate this would be if we can make the shrinker
> api take a *const* struct scan_control pointer as an argument, so that
> it'll be clear that we expect the shrinkers to only read the
> information in that struct.
Well, we might want callees to update fields in there, say "number of
bytes I managed to reclaim" or such. We do that with
writeback_control.pages_skipped and it is comfortable enough.
--
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/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2010-11-23 2:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-18 4:34 [PATCH] Pass priority to shrink_slab Ying Han
2010-11-18 8:59 ` Nick Piggin
2010-11-18 10:06 ` Ying Han
2010-11-18 10:24 ` Michel Lespinasse
2010-11-19 22:25 ` Andrew Morton
2010-11-20 3:23 ` Ying Han
2010-11-22 23:06 ` Andrew Morton
2010-11-23 2:09 ` Michel Lespinasse
2010-11-23 2:26 ` Andrew Morton [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=20101122182627.11677116.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=minchan.kim@gmail.com \
--cc=npiggin@gmail.com \
--cc=npiggin@kernel.dk \
--cc=riel@redhat.com \
--cc=walken@google.com \
--cc=yinghan@google.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).