Skip to content

Commit b6a6045

Browse files
Hugh DickinsLinus Torvalds
authored andcommitted
[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 <hugh@veritas.com> Acked-by: Christoph Lameter <clameter@sgi.com> Acked-by: Pekka J Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent be6aab0 commit b6a6045

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/slab.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3281,7 +3281,7 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
32813281
flags | GFP_THISNODE, nid);
32823282
}
32833283

3284-
if (!obj) {
3284+
if (!obj && !(flags & __GFP_NO_GROW)) {
32853285
/*
32863286
* This allocation will be performed within the constraints
32873287
* of the current cpuset / memory policy requirements.
@@ -3310,7 +3310,7 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
33103310
*/
33113311
goto retry;
33123312
} else {
3313-
kmem_freepages(cache, obj);
3313+
/* cache_grow already freed obj */
33143314
obj = NULL;
33153315
}
33163316
}

0 commit comments

Comments
 (0)