linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Vyukov <dvyukov@google.com>
To: Christopher Lameter <cl@linux.com>
Cc: Dmitry Vyukov <dvyukov@gmail.com>,
	Pekka Enberg <penberg@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Linux-MM <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: don't warn about large allocations for slab
Date: Thu, 27 Sep 2018 19:17:01 +0200	[thread overview]
Message-ID: <CACT4Y+atu0Fz0Bhqn+7qpRowySEVWXV+vwVbBZ5y3Z+NnSpLsQ@mail.gmail.com> (raw)
In-Reply-To: <010001661bba2bbc-a5074e00-2009-414a-be8c-05c58545c7ec-000000@email.amazonses.com>

On Thu, Sep 27, 2018 at 5:51 PM, Christopher Lameter <cl@linux.com> wrote:
> On Thu, 27 Sep 2018, Dmitry Vyukov wrote:
>
>> From: Dmitry Vyukov <dvyukov@google.com>
>>
>> This warning does not seem to be useful. Most of the time it fires when
>> allocation size depends on syscall arguments. We could add __GFP_NOWARN
>> to these allocation sites, but having a warning only to suppress it
>> does not make lots of sense. Moreover, this warnings never fires for
>> constant-size allocations and never for slub, because there are
>> additional checks and fallback to kmalloc_large() for large allocations
>> and kmalloc_large() does not warn. So the warning only fires for
>> non-constant allocations and only with slab, which is odd to begin with.
>> The warning leads to episodic unuseful syzbot reports. Remote it.
>
> /Remove/
>
> If its only for slab then KMALLOC_MAX_CACHE_SIZE and KMALLOC_MAX_SIZE are
> the same value.
>
>> While we are here also fix the check. We should check against
>> KMALLOC_MAX_CACHE_SIZE rather than KMALLOC_MAX_SIZE. It all kinda
>> worked because for slab the constants are the same, and slub always
>> checks the size against KMALLOC_MAX_CACHE_SIZE before kmalloc_slab().
>> But if we get there with size > KMALLOC_MAX_CACHE_SIZE anyhow
>> bad things will happen.
>
> Then the WARN_ON is correct just change the constant used. Ensure that
> SLAB does the same checks as SLUB.

Mailed v2 which adds the checks to slab.

I think the warning is still slightly wrong. It means a bug in slab
code, it has nothing to do with user-passed flags.

      reply	other threads:[~2018-09-27 17:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-27 13:07 Dmitry Vyukov
2018-09-27 15:51 ` Christopher Lameter
2018-09-27 17:17   ` Dmitry Vyukov [this message]

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=CACT4Y+atu0Fz0Bhqn+7qpRowySEVWXV+vwVbBZ5y3Z+NnSpLsQ@mail.gmail.com \
    --to=dvyukov@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=dvyukov@gmail.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.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