mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: David Miller <davem@davemloft.net>
Cc: kosaki.motohiro@jp.fujitsu.com, akpm@linux-foundation.org,
	csnook@redhat.com, davej@codemonkey.org.uk,
	nickpiggin@yahoo.com.au, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, Michael Chan <mchan@broadcom.com>
Subject: Re: GFP_ATOMIC page allocation failures.
Date: Wed, 02 Apr 2008 19:00:25 +0900	[thread overview]
Message-ID: <20080402175857.959A.KOSAKI.MOTOHIRO@jp.fujitsu.com> (raw)
In-Reply-To: <20080402.012406.246863209.davem@davemloft.net>

Hi

> > if network guys hope known-good driver should call 
> > __netdev_alloc_skb(dev, length, GFP_ATOMIC|__GFP_NOWARN) instead netdev_alloc_skb,
> > I think we should make netdev_alloc_skb_nowarn.
> 
> Giving it a proper name like this takes away the indication that this
> situation is very special.

Hmmm,

at least, tg3 driver often output the same message on my test environment.
(because I often run stress test ;)
I doubt almost driver has the same problem under heavy workload.

and I think tg3 is known-good driver too.
because its alloc failure doesn't cause any bad thing at all.

Do you favorite the following patch?


---------------------------------------------------------------------
We get rather a lot of reports of page allocation warnings coming out of
tg3.  But this driver is know to handle them properly so let's suppress
them.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: David Miller <davem@davemloft.net>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Michael Chan <mchan@broadcom.com>
---
 drivers/net/tg3.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Index: b/drivers/net/tg3.c
===================================================================
--- a/drivers/net/tg3.c 2008-03-14 21:38:12.000000000 +0900
+++ b/drivers/net/tg3.c 2008-04-02 18:54:15.000000000 +0900
@@ -307,6 +307,11 @@ static const struct {
        { "interrupt test (offline)" },
 };

+static inline void *tg3_alloc_skb(struct net_device *dev, unsigned int length)
+{
+       return __netdev_alloc_skb(dev, length, GFP_ATOMIC|__GFP_NOWARN);
+}
+
 static void tg3_write32(struct tg3 *tp, u32 off, u32 val)
 {
        writel(val, tp->regs + off);
@@ -3437,7 +3442,7 @@ static int tg3_alloc_rx_skb(struct tg3 *
         * Callers depend upon this behavior and assume that
         * we leave everything unchanged if we fail.
         */
-       skb = netdev_alloc_skb(tp->dev, skb_size);
+       skb = tg3_alloc_skb(tp->dev, skb_size);
        if (skb == NULL)
                return -ENOMEM;
@@ -3609,7 +3614,7 @@ static int tg3_rx(struct tg3 *tp, int bu
                        tg3_recycle_rx(tp, opaque_key,
                                       desc_idx, *post_ptr);

-                       copy_skb = netdev_alloc_skb(tp->dev, len + 2);
+                       copy_skb = tg3_alloc_skb(tp->dev, len + 2);
                        if (copy_skb == NULL)
                                goto drop_it_no_recycle;

@@ -9370,7 +9375,7 @@ static int tg3_run_loopback(struct tg3 *
        err = -EIO;

        tx_len = 1514;
-       skb = netdev_alloc_skb(tp->dev, tx_len);
+       skb = tg3_alloc_skb(tp->dev, tx_len);
        if (!skb)
                return -ENOMEM;



  parent reply	other threads:[~2008-04-02 10:01 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-01 23:56 Dave Jones
2008-04-02  1:28 ` Nick Piggin
2008-04-02  1:35   ` Dave Jones
2008-04-02  6:28     ` Chris Snook
2008-04-02  7:56       ` Andrew Morton
2008-04-02  8:17         ` KOSAKI Motohiro
2008-04-02  8:24           ` David Miller
2008-04-02  8:43             ` Andrew Morton
2008-04-02 10:00             ` KOSAKI Motohiro [this message]
2008-04-02 10:56               ` KOSAKI Motohiro
2008-04-02 18:44                 ` David Miller
2008-04-02 20:12                   ` Michael Chan
2008-04-02 20:53                     ` David Miller
2008-04-02 11:04             ` Peter Zijlstra
2008-04-02 18:45               ` David Miller
2008-04-02 19:06                 ` Jeff Garzik
2008-04-02  9:12         ` Nick Piggin
2008-04-02 15:54           ` Andrew Morton
2008-04-03  5:22             ` Nick Piggin
2008-04-03  5:32               ` Andrew Morton
2008-04-03  8:59                 ` Evgeniy Polyakov
2008-06-26 21:06                   ` Dave Jones
2008-06-26 22:26                     ` Chris Snook
2008-06-27 10:01                     ` Evgeniy Polyakov
2008-04-02 17:21         ` Jeff Garzik
2008-04-02 17:33           ` Andrew Morton
2008-04-02 18:18             ` Jeff Garzik
2008-04-02 18:37               ` Kok, Auke
2008-04-03  5:57               ` Nick Piggin
2008-04-03 18:20                 ` Jeff Garzik
     [not found] <adYyJ-20N-11@gated-at.bofh.it>
     [not found] ` <aef6w-6rx-45@gated-at.bofh.it>
     [not found]   ` <aefJ9-7KR-15@gated-at.bofh.it>
     [not found]     ` <aeqF6-45P-29@gated-at.bofh.it>
2008-04-04  9:52       ` Bodo Eggert
2008-04-04 10:59         ` Nick Piggin
2008-04-04 11:35           ` Bodo Eggert
2008-04-05  1:06             ` Nick Piggin
2008-04-06 12:12               ` Bodo Eggert

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=20080402175857.959A.KOSAKI.MOTOHIRO@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=csnook@redhat.com \
    --cc=davej@codemonkey.org.uk \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    /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

all inboxes | Powered by JetHome®