All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Rientjes <rientjes@google.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Justin Piszcz <jpiszcz@lucidpixels.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [patch] ipv4: don't warn about skb ack allocation failures
Date: Thu, 18 Jun 2009 00:30:58 +0200	[thread overview]
Message-ID: <4A396EA2.60705@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.0906171401440.7198@chino.kir.corp.google.com>

David Rientjes a écrit :
> On Wed, 17 Jun 2009, Eric Dumazet wrote:
> 
>>> Yes, if they are recoverable without any side effects.  Otherwise, they 
>>> will continue to emit page allocation failure messages which cause users 
>>> to waste their time when they recognize a problem of an unknown 
>>> seriousness level in both reporting the issue and looking for resulting 
>>> corruption.  The __GFP_NOWARN annotation suppresses such warnings for 
>>> those very reasons.
>> Then why emit the warning at first place ?
>>
>> Once we patch all call sites to use GFP_ATOMIC | __GFP_NOWARN, I bet 99% 
>> GFP_ATOMIC allocations in kernel will use it, so we go back to silent mode.
>>
>> If a GFP_ATOMIC call site *cannot* use __GFP_NOWARN, it will either :
>>
>> - call panic()
>> - crash with a nice stack trace because caller was not aware NULL could be
>> returned by kmalloc()
>>
>>
>> Maybe GFP_ATOMIC should include __GFP_NOWARN
>>
>> #define GFP_ATOMIC  (__GFP_HIGH)
>> ->
>> #define GFP_ATOMIC  (__GFP_HIGH | __GFP_NOWARN)
>>
> 
> You must now mask off __GFP_NOWARN in the gfp flags for the allocation if 
> you have a GFP_ATOMIC allocation that wants the page allocation failure 
> warning messages.  That message includes pertinent information with regard 
> to the state of the VM that is otherwise unavailable by a BUG_ON() or NULL 
> pointer dereference.
> 
> For example, I could only diagnose Justin's failure as a harmless page 
> allocator warning because I could identify its caller, the gfp mask of the 
> allocation attempt, and the memory available.  It would not have otherwise 
> been possible to find that the system was actually oom.
> 
> The general principle is that it is up to the caller to know whether an 
> allocation failure is recoverable or not and not up to any VM 
> implementation.

My point is that 99% of callers know allocation failures are
recoverable.

Instead of patching 10000 places in kernel, just patch 10 places where
allocations failures are not recoverable and call BUG() or whatever
lovely debugging aid (using __GFP_NOFAIL for example, I dont know)

GFP_NOWARN should be the default, and GFP_WARN_AND_FULL_EXPLANATION the exception.

In the past, only high order page allocations could trigger some trace,
I wonder why current kernels want to warn that an allocation failed,
since kmalloc(sz, GFP_ATOMIC) is allowed to return NULL and always was.


  reply	other threads:[~2009-06-17 22:31 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.DEB.2.00.0906161203160.27742@p34.internal.lan>
2009-06-16 16:06 ` 2.6.29.1: nfsd: page allocation failure - nfsd or kernel problem? Justin Piszcz
2009-06-16 20:19   ` Michael Tokarev
2009-06-17  8:43     ` Michael Tokarev
2009-06-17  9:43       ` Justin Piszcz
2009-06-17 10:39         ` Michael Tokarev
2009-06-17 18:51           ` J. Bruce Fields
2009-06-17 20:24             ` Michael Tokarev
2009-06-17 20:39               ` David Rientjes
2009-06-18  8:54                 ` Michael Tokarev
2009-06-18 17:07                   ` David Rientjes
2009-06-18 17:56                     ` Michael Tokarev
2009-06-18 18:12                       ` J. Bruce Fields
2009-06-18 18:15                       ` David Rientjes
2009-06-17 22:45               ` J. Bruce Fields
2009-06-18  0:14               ` Zdenek Kaspar
2009-06-17 19:44   ` [patch] ipv4: don't warn about skb ack allocation failures David Rientjes
2009-06-17 20:16     ` Eric Dumazet
2009-06-17 20:33       ` David Rientjes
2009-06-17 20:52         ` Eric Dumazet
2009-06-17 21:12           ` David Rientjes
2009-06-17 22:30             ` Eric Dumazet [this message]
2009-06-17 23:08               ` David Miller
2009-06-18 16:56                 ` David Rientjes
2009-06-18 19:00                   ` David Miller
2009-06-18 19:23                     ` David Rientjes
2009-06-18 19:37                       ` David Miller
2009-06-19 19:45                         ` David Rientjes
2009-06-19 20:41                         ` Eric W. Biederman
2009-06-19 22:37                           ` David Rientjes
2009-06-19 23:04                             ` David Miller
2009-06-20  1:28                             ` Eric W. Biederman
2009-06-19 23:03                           ` David Miller
2009-06-22 16:08 ` 2.6.30: nfsd: page allocation failure - nfsd or kernel problem? (again with 2.6.30) Justin Piszcz

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=4A396EA2.60705@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jpiszcz@lucidpixels.com \
    --cc=linux-kernel@vger.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 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.