netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: swalter@lexmark.com
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	swalter <swalter@swalter-d630.vyatta.com (none) >,
	Steven Walter <swalter@lexmark.com>
Subject: Re: [PATCH] dev_alloc_skb: avoid using GFP_ATOMIC
Date: Tue, 29 Sep 2009 09:58:42 -0700	[thread overview]
Message-ID: <20090929095842.7038ca0e@nehalam> (raw)
In-Reply-To: <1254242593-2279-1-git-send-email-swalter@lexmark.com>

On Tue, 29 Sep 2009 12:43:13 -0400
swalter@lexmark.com wrote:

> From: swalter <swalter@swalter-d630.(none)>
> 
> 
> Signed-off-by: Steven Walter <swalter@lpdev.prtdev.lexmark.com>
> ---
>  net/core/skbuff.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 9e0597d..58ec625 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -306,7 +306,11 @@ struct sk_buff *dev_alloc_skb(unsigned int length)
>  	 * There is more code here than it seems:
>  	 * __dev_alloc_skb is an inline
>  	 */
> -	return __dev_alloc_skb(length, GFP_ATOMIC);
> +	if (in_interrupt()  ||  in_atomic()  ||  irqs_disabled()) {
> +		return __dev_alloc_skb(length, GFP_ATOMIC);
> +	} else {
> +		return __dev_alloc_skb(length, GFP_KERNEL);
> +	}
>  }
>  EXPORT_SYMBOL(dev_alloc_skb);
>  

No, this should be fixed by caller (using netdev_alloc_skb)
also, it may break cases like swap over NFS that want to get memory
when memory pool is low


-- 

      reply	other threads:[~2009-09-29 16:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-29 16:43 [PATCH] dev_alloc_skb: avoid using GFP_ATOMIC swalter
2009-09-29 16:58 ` Stephen Hemminger [this message]

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=20090929095842.7038ca0e@nehalam \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=swalter@lexmark.com \
    --cc=swalter@swalter-d630.vyatta.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).