Skip to content

Commit

Permalink
[PATCH] fix BUG_ON(!PageSlab) from fallback_alloc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Jan 6, 2007
1 parent be6aab0 commit b6a6045
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit b6a6045

Please sign in to comment.