From: Joonsoo Kim Date: Wed, 19 Jun 2013 06:33:55 +0000 (+0900) Subject: slub: do not put a slab to cpu partial list when cpu_partial is 0 X-Git-Tag: v3.11-rc1~1^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=318df36e57c0ca9f2146660d41ff28e8650af423;p=thirdparty%2Fkernel%2Flinux.git slub: do not put a slab to cpu partial list when cpu_partial is 0 In free path, we don't check number of cpu_partial, so one slab can be linked in cpu partial list even if cpu_partial is 0. To prevent this, we should check number of cpu_partial in put_cpu_partial(). Acked-by: Christoph Lameeter Reviewed-by: Wanpeng Li Signed-off-by: Joonsoo Kim Signed-off-by: Pekka Enberg --- diff --git a/mm/slub.c b/mm/slub.c index 5ee6c7cd9fc43..54cc4d544f3cb 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1954,6 +1954,9 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain) int pages; int pobjects; + if (!s->cpu_partial) + return; + do { pages = 0; pobjects = 0;