All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slab: prevent warnings when allocating with __GFP_NOWARN
@ 2013-06-10 19:18 ` Sasha Levin
  0 siblings, 0 replies; 44+ messages in thread
From: Sasha Levin @ 2013-06-10 19:18 UTC (permalink / raw)
  To: penberg, cl; +Cc: linux-mm, akpm, linux-kernel, Sasha Levin

slab would still spew a warning when a big allocation happens with the
__GFP_NOWARN fleg is set. Prevent that to conform to __GFP_NOWARN.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 mm/slab_common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/slab_common.c b/mm/slab_common.c
index ff3218a..2d41450 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -373,8 +373,10 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags)
 {
 	int index;
 
-	if (WARN_ON_ONCE(size > KMALLOC_MAX_SIZE))
+	if (size > KMALLOC_MAX_SIZE) {
+		WARN_ON_ONCE(!(flags & __GFP_NOWARN));
 		return NULL;
+	}
 
 	if (size <= 192) {
 		if (!size)
-- 
1.8.2.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2013-06-13  7:03 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-10 19:18 [PATCH] slab: prevent warnings when allocating with __GFP_NOWARN Sasha Levin
2013-06-10 19:18 ` Sasha Levin
2013-06-10 19:31 ` Pekka Enberg
2013-06-10 19:31   ` Pekka Enberg
2013-06-10 19:56   ` Sasha Levin
2013-06-10 19:56     ` Sasha Levin
2013-06-10 23:40     ` Christoph Lameter
2013-06-10 23:40       ` Christoph Lameter
2013-06-11  0:54       ` Sasha Levin
2013-06-11  0:54         ` Sasha Levin
2013-06-11  6:28         ` Pekka Enberg
2013-06-11  6:28           ` Pekka Enberg
2013-06-11 13:16           ` Sasha Levin
2013-06-11 13:16             ` Sasha Levin
2013-06-11 15:14             ` Christoph Lameter
2013-06-11 15:14               ` Christoph Lameter
2013-06-11 15:16               ` Pekka Enberg
2013-06-11 15:16                 ` Pekka Enberg
2013-06-11 15:23                 ` Christoph Lameter
2013-06-11 15:23                   ` Christoph Lameter
2013-06-11 15:44                   ` Sasha Levin
2013-06-11 15:44                     ` Sasha Levin
2013-06-11 16:13                     ` Eric Dumazet
2013-06-11 16:13                       ` Eric Dumazet
2013-06-11 16:19                       ` Sasha Levin
2013-06-11 16:19                         ` Sasha Levin
2013-06-11 16:37                         ` Eric Dumazet
2013-06-11 16:37                           ` Eric Dumazet
2013-06-11 16:43                           ` Dave Jones
2013-06-11 16:43                             ` Dave Jones
2013-06-11 19:02                           ` Sasha Levin
2013-06-11 19:02                             ` Sasha Levin
2013-06-12 13:01                           ` Christoph Lameter
2013-06-12 13:01                             ` Christoph Lameter
2013-06-11 16:28                       ` Christoph Lameter
2013-06-11 16:28                         ` Christoph Lameter
2013-06-11 22:34                 ` Andrew Morton
2013-06-11 22:34                   ` Andrew Morton
2013-06-13  7:03                   ` Pekka Enberg
2013-06-13  7:03                     ` Pekka Enberg
2013-06-11 22:10               ` David Rientjes
2013-06-11 22:10                 ` David Rientjes
2013-06-11 15:08         ` Christoph Lameter
2013-06-11 15:08           ` Christoph Lameter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.