From: Joonsoo Kim Date: Fri, 7 Sep 2012 00:17:44 +0000 (+1000) Subject: slab: fix starting index for finding another object X-Git-Tag: next-20120910~2^2~238 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b6700267ac8b4981f8bb4cd0d30414bfada54331;p=karo-tx-linux.git slab: fix starting index for finding another object In array cache, there is a object at index 0, check it. Signed-off-by: Joonsoo Kim Signed-off-by: Mel Gorman Cc: David Miller Cc: Chuck Lever Cc: David Rientjes Cc: Pekka Enberg Signed-off-by: Andrew Morton --- diff --git a/mm/slab.c b/mm/slab.c index 1a8641583337..d787688c48ed 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -976,7 +976,7 @@ static void *__ac_get_obj(struct kmem_cache *cachep, struct array_cache *ac, } /* The caller cannot use PFMEMALLOC objects, find another one */ - for (i = 1; i < ac->avail; i++) { + for (i = 0; i < ac->avail; i++) { /* If a !PFMEMALLOC object is found, swap them */ if (!is_obj_pfmemalloc(ac->entry[i])) { objp = ac->entry[i];