提交 d014dc2e 编写于 作者: J Joonsoo Kim 提交者: Linus Torvalds

slab: fix starting index for finding another object

In array cache, there is a object at index 0, check it.
Signed-off-by: NJoonsoo Kim <js1304@gmail.com>
Signed-off-by: NMel Gorman <mgorman@suse.de>
Cc: David Miller <davem@davemloft.net>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 30c29bea
...@@ -983,7 +983,7 @@ static void *__ac_get_obj(struct kmem_cache *cachep, struct array_cache *ac, ...@@ -983,7 +983,7 @@ static void *__ac_get_obj(struct kmem_cache *cachep, struct array_cache *ac,
} }
/* The caller cannot use PFMEMALLOC objects, find another one */ /* 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 a !PFMEMALLOC object is found, swap them */
if (!is_obj_pfmemalloc(ac->entry[i])) { if (!is_obj_pfmemalloc(ac->entry[i])) {
objp = ac->entry[i]; objp = ac->entry[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册