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-20120907~1^2~240 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3c4a69a9783f05e6f26b78382742f1e6dcab9b28;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 a32609d3f72e..9a91049f02bc 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];