[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090929095842.7038ca0e@nehalam>
Date: Tue, 29 Sep 2009 09:58:42 -0700
From: Stephen Hemminger <shemminger@...tta.com>
To: swalter@...mark.com
Cc: davem@...emloft.net, netdev@...r.kernel.org,
swalter <swalter@...lter-d630.vyatta.com (none) >,
Steven Walter <swalter@...mark.com>
Subject: Re: [PATCH] dev_alloc_skb: avoid using GFP_ATOMIC
On Tue, 29 Sep 2009 12:43:13 -0400
swalter@...mark.com wrote:
> From: swalter <swalter@...lter-d630.(none)>
>
>
> Signed-off-by: Steven Walter <swalter@...ev.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
--
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists