public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Rientjes <rientjes@google.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	"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: Wed, 17 Jun 2009 22:52:49 +0200	[thread overview]
Message-ID: <4A3957A1.5030407@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.0906171326120.4786@chino.kir.corp.google.com>

David Rientjes a écrit :
> On Wed, 17 Jun 2009, Eric Dumazet wrote:
> 
>>> ipv4: don't warn about skb ack allocation failures
>>>
>>> tcp_send_ack() will recover from alloc_skb() allocation failures, so avoid 
>>> emitting warnings.
>>>
>>> Signed-off-by: David Rientjes <rientjes@google.com>
>>> ---
>>> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
>>> --- a/net/ipv4/tcp_output.c
>>> +++ b/net/ipv4/tcp_output.c
>>> @@ -2442,7 +2442,7 @@ void tcp_send_ack(struct sock *sk)
>>>  	 * tcp_transmit_skb() will set the ownership to this
>>>  	 * sock.
>>>  	 */
>>> -	buff = alloc_skb(MAX_TCP_HEADER, GFP_ATOMIC);
>>> +	buff = alloc_skb(MAX_TCP_HEADER, GFP_ATOMIC | __GFP_NOWARN);
>>>  	if (buff == NULL) {
>>>  		inet_csk_schedule_ack(sk);
>>>  		inet_csk(sk)->icsk_ack.ato = TCP_ATO_MIN;
>> I count more than 800 GFP_ATOMIC allocations in net/ tree.
>>
>> Most (if not all) of them can recover in case of failures.
>>
>> Should we add __GFP_NOWARN to all of them ?
>>
> 
> 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)


  reply	other threads:[~2009-06-17 20:53 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 [this message]
2009-06-17 21:12           ` David Rientjes
2009-06-17 22:30             ` Eric Dumazet
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=4A3957A1.5030407@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox