[PATCH] SLUB: Don't print out OOM warning for __GFP_NOFAIL

From: Pekka Enberg
Date: Thu Jun 11 2009 - 09:18:09 EST


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@xxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxxxxxx>
---
mm/slub.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index c0d5341..4d7cabf 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1631,7 +1631,8 @@ new_slab:
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))
--
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/