linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Nick Piggin <npiggin@kernel.dk>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, Frank Mayhar <fmayhar@google.com>,
	John Stultz <johnstul@us.ibm.com>
Cc: kosaki.motohiro@jp.fujitsu.com
Subject: Re: [PATCH 1/2] vmscan: shrink_all_slab() use reclaim_state instead the return value of shrink_slab()
Date: Sat, 24 Jul 2010 21:05:05 +0900	[thread overview]
Message-ID: <AANLkTimno0L3_6VmF11XavxLpQ1BibQ=kZUzFyF7axdb@mail.gmail.com> (raw)
In-Reply-To: <20100724174405.3C99.A69D9226@jp.fujitsu.com>

2010/7/24 KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>:
> Now, shrink_slab() doesn't return number of reclaimed objects. IOW,
> current shrink_all_slab() is broken. Thus instead we use reclaim_state
> to detect no reclaimable slab objects.
>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> ---
>  mm/vmscan.c |   20 +++++++++-----------
>  1 files changed, 9 insertions(+), 11 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index d7256e0..bfa1975 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -300,18 +300,16 @@ static unsigned long shrink_slab(struct zone *zone, unsigned long scanned, unsig
>  void shrink_all_slab(void)
>  {
>        struct zone *zone;
> -       unsigned long nr;
> +       struct reclaim_state reclaim_state;
>
> -again:
> -       nr = 0;
> -       for_each_zone(zone)
> -               nr += shrink_slab(zone, 1, 1, 1, GFP_KERNEL);
> -       /*
> -        * If we reclaimed less than 10 objects, might as well call
> -        * it a day. Nothing special about the number 10.
> -        */
> -       if (nr >= 10)
> -               goto again;
> +       current->reclaim_state = &reclaim_state;
> +       do {
> +               reclaim_state.reclaimed_slab = 0;
> +               for_each_zone(zone)

Oops, this should be for_each_populated_zone().


> +                       shrink_slab(zone, 1, 1, 1, GFP_KERNEL);
> +       } while (reclaim_state.reclaimed_slab);
> +
> +       current->reclaim_state = NULL;
>  }
>
>  static inline int is_page_cache_freeable(struct page *page)
> --
> 1.6.5.2
>
>
>
> --
> 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>
>

--
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:[~2010-07-24 12:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22 19:01 VFS scalability git tree Nick Piggin
2010-07-23 11:13 ` Dave Chinner
2010-07-23 14:04   ` [PATCH 0/2] vfs scalability tree fixes Dave Chinner
2010-07-23 16:09     ` Nick Piggin
2010-07-23 14:04   ` [PATCH 1/2] xfs: fix shrinker build Dave Chinner
2010-07-23 14:04   ` [PATCH 2/2] xfs: shrinker should use a per-filesystem scan count Dave Chinner
2010-07-23 15:51   ` VFS scalability git tree Nick Piggin
2010-07-24  0:21     ` Dave Chinner
2010-07-23 11:17 ` Christoph Hellwig
2010-07-23 15:42   ` Nick Piggin
2010-07-23 13:55 ` Dave Chinner
2010-07-23 16:16   ` Nick Piggin
2010-07-27  7:05   ` Nick Piggin
2010-07-27 11:09     ` Nick Piggin
2010-07-27 13:18     ` Dave Chinner
2010-07-27 15:09       ` Nick Piggin
2010-07-28  4:59         ` Dave Chinner
2010-07-23 15:35 ` Nick Piggin
2010-07-24  8:43 ` KOSAKI Motohiro
2010-07-24  8:44   ` [PATCH 1/2] vmscan: shrink_all_slab() use reclaim_state instead the return value of shrink_slab() KOSAKI Motohiro
2010-07-24 12:05     ` KOSAKI Motohiro [this message]
2010-07-24  8:46   ` [PATCH 2/2] vmscan: change shrink_slab() return tyep with void KOSAKI Motohiro
2010-07-24 10:54   ` VFS scalability git tree KOSAKI Motohiro
2010-07-26  5:41 ` Nick Piggin
2010-07-28 10:24   ` Nick Piggin
2010-07-30  9:12 ` Nick Piggin
2010-08-03  0:27   ` john stultz
2010-08-03  5:44     ` 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='AANLkTimno0L3_6VmF11XavxLpQ1BibQ=kZUzFyF7axdb@mail.gmail.com' \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --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 \
    --cc=npiggin@kernel.dk \
    /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