From: Josef Bacik <josef@toxicpanda.com>
To: Minchan Kim <minchan@kernel.org>
Cc: josef@toxicpanda.com, akpm@linux-foundation.org,
kernel-team@fb.com, linux-mm@kvack.org, hannes@cmpxchg.org,
riel@redhat.com, Josef Bacik <jbacik@fb.com>
Subject: Re: [PATCH 2/4][v2] vmscan: bailout of slab reclaim once we reach our target
Date: Wed, 5 Jul 2017 08:57:26 -0400 [thread overview]
Message-ID: <20170705125725.GA16179@destiny> (raw)
In-Reply-To: <20170705042704.GA20079@bbox>
On Wed, Jul 05, 2017 at 01:27:04PM +0900, Minchan Kim wrote:
> On Tue, Jul 04, 2017 at 08:33:38AM -0400, josef@toxicpanda.com wrote:
> > From: Josef Bacik <jbacik@fb.com>
> >
> > Following patches will greatly increase our aggressiveness in slab
> > reclaim, so we need checks in place to make sure we stop trying to
> > reclaim slab once we've hit our reclaim target.
> >
> > Signed-off-by: Josef Bacik <jbacik@fb.com>
> > ---
> > v1->v2:
> > - Don't bail out in shrink_slab() so that we always scan at least batch_size
> > objects of every slab regardless of wether we've hit our target or not.
>
> It's no different with v1 for aging fairness POV.
>
> Imagine you have 3 shrinkers in shrinker_list and A has a lots of objects.
>
> HEAD-> A -> B -> C
>
> shrink_slab does scan/reclaims from A srhinker a lot until it meets
> sc->nr_to_reclaim. Then, VM does aging B and C with batch_size which is
> rather small. It breaks fairness.
>
> In next memory pressure, it shrinks A a lot again but B and C
> a little bit.
>
Oh duh yeah I see what you are saying. I had a scheme previously to break up
the scanning targets based on overall usage but it meant looping through the
shrinkers twice, as we have to get a total count of objects first to determine
individual ratios. I suppose since there's relatively low cost to getting
object counts per shrinker and there don't tend to be a lot of shrinkers we
could go with this to make it more fair. I'll write this up. Thanks,
Josef
--
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:[~2017-07-05 12:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 12:33 [PATCH 1/4] vmscan: push reclaim_state down to shrink_node() josef
2017-07-04 12:33 ` [PATCH 2/4][v2] vmscan: bailout of slab reclaim once we reach our target josef
2017-07-05 4:27 ` Minchan Kim
2017-07-05 12:57 ` Josef Bacik [this message]
2017-07-04 12:33 ` [PATCH 3/4] mm: use slab size in the slab shrinking ratio calculation josef
2017-07-04 12:33 ` [PATCH 4/4] mm: make kswapd try harder to keep active pages in cache josef
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=20170705125725.GA16179@destiny \
--to=josef@toxicpanda.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=jbacik@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=riel@redhat.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).