From: Andrew Morton <akpm@linux-foundation.org>
To: David Rientjes <rientjes@google.com>
Cc: Pekka Enberg <penberg@kernel.org>,
Christoph Lameter <cl@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch] mm, slab: suppress out of memory warning unless debug is enabled
Date: Wed, 7 May 2014 14:48:58 -0700 [thread overview]
Message-ID: <20140507144858.9aee4e420908ccf9334dfdf2@linux-foundation.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1405071431580.8454@chino.kir.corp.google.com>
On Wed, 7 May 2014 14:36:34 -0700 (PDT) David Rientjes <rientjes@google.com> wrote:
> On Wed, 7 May 2014, Andrew Morton wrote:
>
> > > When the slab or slub allocators cannot allocate additional slab pages, they
> > > emit diagnostic information to the kernel log such as current number of slabs,
> > > number of objects, active objects, etc. This is always coupled with a page
> > > allocation failure warning since it is controlled by !__GFP_NOWARN.
> > >
> > > Suppress this out of memory warning if the allocator is configured without debug
> > > supported. The page allocation failure warning will indicate it is a failed
> > > slab allocation, so this is only useful to diagnose allocator bugs.
> > >
> > > Since CONFIG_SLUB_DEBUG is already enabled by default for the slub allocator,
> > > there is no functional change with this patch. If debug is disabled, however,
> > > the warnings are now suppressed.
> > >
> >
> > I'm not seeing any reason for making this change.
> >
>
> You think the spam in http://marc.info/?l=linux-kernel&m=139927773010514
> is meaningful? It also looks like two different errors when in reality it
> is a single allocation.
>
> Unless you're debugging a slab issue, all the pertinent information is
> already available in the page allocation failure warning emitted by the
> page allocator: we already have the order and gfp mask. We also know it's
> a slab allocation because of the __kmalloc in the call trace.
>
> Does this user care about that there are 207 slabs on node 0 with 207
> objects? Probably only if they are diagnosing a slab problem.
I'd prefer something which can be added to the changelog to address
this omission over a series of rhetorical questions.
> > > @@ -1621,11 +1621,17 @@ __initcall(cpucache_init);
> > > static noinline void
> > > slab_out_of_memory(struct kmem_cache *cachep, gfp_t gfpflags, int nodeid)
> > > {
> > > +#if DEBUG
> > > struct kmem_cache_node *n;
> > > struct page *page;
> > > unsigned long flags;
> > > int node;
> > >
> > > + if (gfpflags & __GFP_NOWARN)
> > > + return;
> > > + if (!printk_ratelimit())
> > > + return;
> >
> > printk_ratelimit() is lame - it uses a single global state. So if
> > random net driver is using printk_ratelimit(), that driver and slab
> > will interfere with each other.
> >
>
> Agreed, but it is a testiment to the uselessness of this information
> already. The page allocation failure warnings are controlled by their own
> ratelimiter, nopage_rs, but that's local to the page allocator. Do you
> prefer that all these ratelimiters be moved to the global namespace for
> generic use?
As these messages are related then it probably makes sense for them to
use a common ratelimit_state, hopefully local to slab.c.
--
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:[~2014-05-07 21:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-07 21:19 [patch] mm, slab: suppress out of memory warning unless debug is enabled David Rientjes
2014-05-07 21:29 ` Andrew Morton
2014-05-07 21:36 ` David Rientjes
2014-05-07 21:48 ` Andrew Morton [this message]
2014-05-07 22:00 ` [patch v2] " David Rientjes
2014-05-08 13:54 ` 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=20140507144858.9aee4e420908ccf9334dfdf2@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--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;
as well as URLs for NNTP newsgroup(s).