From: Hugh Dickins Date: Sat, 6 Jan 2007 00:36:36 +0000 (-0800) Subject: [PATCH] fix BUG_ON(!PageSlab) from fallback_alloc X-Git-Tag: v3.12-rc1~32037 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b6a60451813bad6a9f57cb159004c3b3e12a1cd3;p=kernel%2Fkernel-generic.git [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: Hugh Dickins Acked-by: Christoph Lameter Acked-by: Pekka J Enberg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/slab.c b/mm/slab.c index 0d4e574..c610062 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -3281,7 +3281,7 @@ retry: 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 @@ retry: */ goto retry; } else { - kmem_freepages(cache, obj); + /* cache_grow already freed obj */ obj = NULL; } }