Skip to content

Commit

Permalink
SLUB: Don't print out OOM warning for __GFP_NOFAIL
Browse files Browse the repository at this point in the history
We must check for __GFP_NOFAIL like the page allocator does; otherwise we end
up with false positives. While at it, add the printk_ratelimit() check in SLUB
as well.

Cc: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
  • Loading branch information
Pekka Enberg committed Jun 13, 2009
1 parent 26c02cf commit 95f8598
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,8 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
c->page = new;
goto load_freelist;
}
slab_out_of_memory(s, gfpflags, node);
if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())
slab_out_of_memory(s, gfpflags, node);
return NULL;
debug:
if (!alloc_debug_processing(s, c->page, object, addr))
Expand Down

0 comments on commit 95f8598

Please sign in to comment.