[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOJsxLGDH2iwznRkP-iwiMZw7Ee3mirhjLvhShrWLHR0qguRxA@mail.gmail.com>
Date: Mon, 10 Jun 2013 22:31:15 +0300
From: Pekka Enberg <penberg@...nel.org>
To: Sasha Levin <sasha.levin@...cle.com>
Cc: Christoph Lameter <cl@...ux.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] slab: prevent warnings when allocating with __GFP_NOWARN
Hello Sasha,
On Mon, Jun 10, 2013 at 10:18 PM, Sasha Levin <sasha.levin@...cle.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@...cle.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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists