From: Nick Piggin <npiggin@suse.de>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, John Stultz <johnstul@us.ibm.com>,
Frank Mayhar <fmayhar@google.com>
Subject: Re: [patch 50/52] mm: implement per-zone shrinker
Date: Fri, 25 Jun 2010 02:00:52 +1000 [thread overview]
Message-ID: <20100624160052.GL10441@laptop> (raw)
In-Reply-To: <87aaqkagn9.fsf@basil.nowhere.org>
On Thu, Jun 24, 2010 at 12:06:50PM +0200, Andi Kleen wrote:
> npiggin@suse.de writes:
>
> > Allow the shrinker to do per-zone shrinking. This means it is called for
> > each zone scanned. The shrinker is now completely responsible for calculating
> > and batching (given helpers), which provides better flexibility.
>
> Beyond the scope of this patch, but at some point this probably needs
> to be even more fine grained. With large number of cores/threads in
> each socket a "zone" is actually shared by quite a large number
> of CPUs now and this can cause problems.
Yes, possibly. At least it is a much better step than the big dumb
global list.
> > +void shrinker_add_scan(unsigned long *dst,
> > + unsigned long scanned, unsigned long total,
> > + unsigned long objects, unsigned int ratio)
> > +{
> > + unsigned long long delta;
> > +
> > + delta = (unsigned long long)scanned * objects * ratio;
> > + do_div(delta, total + 1);
> > + delta /= (128ULL / 4ULL);
>
> Again I object to the magic numbers ...
>
> > + nr += shrink_slab(zone, 1, 1, 1, GFP_KERNEL);
> > + if (nr >= 10)
> > + goto again;
>
> And here.
I don't like them either -- problem is they were inherited from the
old code (actually 128 is the fixed point scale, I do have a define
for it just forgot to use it).
I don't know where 4 came from. And 10 is just a random number someone
picked out of a hat :P
> Overall it seems good, but I have not read all the shrinker callback
> changes in all subsystems.
Thanks for looking over it Andi.
--
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:[~2010-06-24 16:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100624030212.676457061@suse.de>
2010-06-24 3:03 ` [patch 50/52] mm: implement per-zone shrinker npiggin
2010-06-24 10:06 ` Andi Kleen
2010-06-24 16:00 ` Nick Piggin [this message]
2010-06-24 16:27 ` Andi Kleen
2010-06-24 16:32 ` Andi Kleen
2010-06-24 16:37 ` Andi Kleen
2010-06-30 6:28 ` Dave Chinner
2010-06-30 12:03 ` Nick Piggin
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=20100624160052.GL10441@laptop \
--to=npiggin@suse.de \
--cc=andi@firstfloor.org \
--cc=fmayhar@google.com \
--cc=johnstul@us.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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).