From: Pekka Enberg <penberg@kernel.org>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: Christoph Lameter <cl@linux.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] slab: prevent warnings when allocating with __GFP_NOWARN
Date: Mon, 10 Jun 2013 22:31:15 +0300 [thread overview]
Message-ID: <CAOJsxLGDH2iwznRkP-iwiMZw7Ee3mirhjLvhShrWLHR0qguRxA@mail.gmail.com> (raw)
In-Reply-To: <1370891880-2644-1-git-send-email-sasha.levin@oracle.com>
Hello Sasha,
On Mon, Jun 10, 2013 at 10:18 PM, Sasha Levin <sasha.levin@oracle.com> wrote:
> 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;
> + }
Does this fix a real problem you're seeing? __GFP_NOWARN is about not
warning if a memory allocation fails but this particular WARN_ON
suggests a kernel bug.
Pekka
--
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>
next prev parent reply other threads:[~2013-06-10 19:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-10 19:18 Sasha Levin
2013-06-10 19:31 ` Pekka Enberg [this message]
2013-06-10 19:56 ` Sasha Levin
2013-06-10 23:40 ` Christoph Lameter
2013-06-11 0:54 ` Sasha Levin
2013-06-11 6:28 ` Pekka Enberg
2013-06-11 13:16 ` Sasha Levin
2013-06-11 15:14 ` Christoph Lameter
2013-06-11 15:16 ` Pekka Enberg
2013-06-11 15:23 ` Christoph Lameter
2013-06-11 15:44 ` Sasha Levin
2013-06-11 16:13 ` Eric Dumazet
2013-06-11 16:19 ` Sasha Levin
2013-06-11 16:37 ` Eric Dumazet
2013-06-11 16:43 ` Dave Jones
2013-06-11 19:02 ` Sasha Levin
2013-06-12 13:01 ` Christoph Lameter
2013-06-11 16:28 ` Christoph Lameter
2013-06-11 22:34 ` Andrew Morton
2013-06-13 7:03 ` Pekka Enberg
2013-06-11 22:10 ` David Rientjes
2013-06-11 15:08 ` Christoph Lameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOJsxLGDH2iwznRkP-iwiMZw7Ee3mirhjLvhShrWLHR0qguRxA@mail.gmail.com \
--to=penberg@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sasha.levin@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox