From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kosaki.motohiro@jp.fujitsu.com, Chris Snook <csnook@redhat.com>,
Dave Jones <davej@codemonkey.org.uk>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Linux Kernel <linux-kernel@vger.kernel.org>,
netdev@vger.kernel.org
Subject: Re: GFP_ATOMIC page allocation failures.
Date: Wed, 02 Apr 2008 17:17:50 +0900 [thread overview]
Message-ID: <20080402171104.9591.KOSAKI.MOTOHIRO@jp.fujitsu.com> (raw)
In-Reply-To: <20080402005646.f8df1c1b.akpm@linux-foundation.org>
Hi
CC'ed netdev
> The appropriate thing to do here is to convert known-good drivers (such as
> e1000[e]) to use __GFP_NOWARN.
>
> Unfortunately netdev_alloc_skb() went and assumed GFP_ATOMIC, but I guess
> we can dive below the covers and use __netdev_alloc_skb():
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.
static inline void *netdev_alloc_skb_nowarn(struct net_device *dev, unsigned int length)
{
return __netdev_alloc_skb(dev, length, GFP_ATOMIC|__GFP_NOWARN);
}
if not, we make unnecessary various alloc_skb
(e.g. e1000_alloc_skb, tg3_alloc_skb, 3com_alloc_skb etc..)
> From: Andrew Morton <akpm@linux-foundation.org>
>
> We get rather a lot of reports of page allocation warnings coming out of
> e1000. But this driver is know to handle them properly so let's suppress
> them.
>
> Cc: Auke Kok <auke-jan.h.kok@intel.com>
> Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Cc: Jeff Garzik <jeff@garzik.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/net/e1000/e1000.h | 4 ++++
> drivers/net/e1000/e1000_main.c | 10 +++++-----
> 2 files changed, 9 insertions(+), 5 deletions(-)
>
> diff -puN drivers/net/e1000/e1000_main.c~e1000-suppress-page-allocation-failure-warnings drivers/net/e1000/e1000_main.c
> --- a/drivers/net/e1000/e1000_main.c~e1000-suppress-page-allocation-failure-warnings
> +++ a/drivers/net/e1000/e1000_main.c
> @@ -4296,7 +4296,7 @@ e1000_clean_rx_irq(struct e1000_adapter
> * of reassembly being done in the stack */
> if (length < copybreak) {
> struct sk_buff *new_skb =
> - netdev_alloc_skb(netdev, length + NET_IP_ALIGN);
> + e1000_alloc_skb(netdev, length + NET_IP_ALIGN);
> if (new_skb) {
> skb_reserve(new_skb, NET_IP_ALIGN);
> skb_copy_to_linear_data_offset(new_skb,
> @@ -4585,7 +4585,7 @@ e1000_alloc_rx_buffers(struct e1000_adap
> goto map_skb;
> }
>
> - skb = netdev_alloc_skb(netdev, bufsz);
> + skb = e1000_alloc_skb(netdev, bufsz);
> if (unlikely(!skb)) {
> /* Better luck next round */
> adapter->alloc_rx_buff_failed++;
> @@ -4598,7 +4598,7 @@ e1000_alloc_rx_buffers(struct e1000_adap
> DPRINTK(RX_ERR, ERR, "skb align check failed: %u bytes "
> "at %p\n", bufsz, skb->data);
> /* Try again, without freeing the previous */
> - skb = netdev_alloc_skb(netdev, bufsz);
> + skb = e1000_alloc_skb(netdev, bufsz);
> /* Failed allocation, critical failure */
> if (!skb) {
> dev_kfree_skb(oldskb);
> @@ -4720,8 +4720,8 @@ e1000_alloc_rx_buffers_ps(struct e1000_a
> rx_desc->read.buffer_addr[j+1] = ~cpu_to_le64(0);
> }
>
> - skb = netdev_alloc_skb(netdev,
> - adapter->rx_ps_bsize0 + NET_IP_ALIGN);
> + skb = e1000_alloc_skb(netdev,
> + adapter->rx_ps_bsize0 + NET_IP_ALIGN);
>
> if (unlikely(!skb)) {
> adapter->alloc_rx_buff_failed++;
> diff -puN drivers/net/e1000/e1000.h~e1000-suppress-page-allocation-failure-warnings drivers/net/e1000/e1000.h
> --- a/drivers/net/e1000/e1000.h~e1000-suppress-page-allocation-failure-warnings
> +++ a/drivers/net/e1000/e1000.h
> @@ -358,5 +358,9 @@ extern void e1000_power_up_phy(struct e1
> extern void e1000_set_ethtool_ops(struct net_device *netdev);
> extern void e1000_check_options(struct e1000_adapter *adapter);
>
> +static inline void *e1000_alloc_skb(struct net_device *dev, unsigned int length)
> +{
> + return __netdev_alloc_skb(dev, length, GFP_ATOMIC|__GFP_NOWARN);
> +}
>
> #endif /* _E1000_H_ */
> _
next prev parent reply other threads:[~2008-04-02 8:18 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 [this message]
2008-04-02 8:24 ` David Miller
2008-04-02 8:43 ` Andrew Morton
2008-04-02 10:00 ` KOSAKI Motohiro
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=20080402171104.9591.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=linux-kernel@vger.kernel.org \
--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®