提交 b6a60451 编写于 作者: H Hugh Dickins 提交者: Linus Torvalds

[PATCH] fix BUG_ON(!PageSlab) from fallback_alloc

pdflush hit the BUG_ON(!PageSlab(page)) in kmem_freepages called from
fallback_alloc: cache_grow already freed those pages when alloc_slabmgmt
failed.  But it wouldn't have freed them if __GFP_NO_GROW, so make sure
fallback_alloc doesn't waste its time on that case.
Signed-off-by: NHugh Dickins <hugh@veritas.com>
Acked-by: NChristoph Lameter <clameter@sgi.com>
Acked-by: NPekka J Enberg <penberg@cs.helsinki.fi>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 be6aab0e
......@@ -3281,7 +3281,7 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
flags | GFP_THISNODE, nid);
}
if (!obj) {
if (!obj && !(flags & __GFP_NO_GROW)) {
/*
* This allocation will be performed within the constraints
* of the current cpuset / memory policy requirements.
......@@ -3310,7 +3310,7 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
*/
goto retry;
} else {
kmem_freepages(cache, obj);
/* cache_grow already freed obj */
obj = NULL;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册