[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTimno0L3_6VmF11XavxLpQ1BibQ=kZUzFyF7axdb@mail.gmail.com>
Date: Sat, 24 Jul 2010 21:05:05 +0900
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To: Nick Piggin <npiggin@...nel.dk>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Frank Mayhar <fmayhar@...gle.com>,
John Stultz <johnstul@...ibm.com>
Cc: kosaki.motohiro@...fujitsu.com
Subject: Re: [PATCH 1/2] vmscan: shrink_all_slab() use reclaim_state instead
the return value of shrink_slab()
2010/7/24 KOSAKI Motohiro <kosaki.motohiro@...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@...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@...ck.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists