From: Neil Horman Subject: Re: [PATCH] net: suppress warnings on dev_alloc_skb Date: Wed, 18 May 2016 15:29:34 -0400 Message-ID: <20160518192934.GD29900@hmsreliant.think-freely.org> References: <1463585124-13086-1-git-send-email-nhorman@tuxdriver.com> <1463587298.18194.129.camel@edumazet-glaptop3.roam.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Eric Dumazet , Netdev , "David S. Miller" To: Alexander Duyck Return-path: Received: from charlotte.tuxdriver.com ([70.61.120.58]:56280 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752009AbcERT3x (ORCPT ); Wed, 18 May 2016 15:29:53 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Wed, May 18, 2016 at 10:57:21AM -0700, Alexander Duyck wrote: > On Wed, May 18, 2016 at 9:01 AM, Eric Dumazet wrote: > > On Wed, 2016-05-18 at 11:25 -0400, Neil Horman wrote: > >> Noticed an allocation failure in a network driver the other day on a 32 bit > >> system: > >> > >> DMA-API: debugging out of memory - disabling > >> bnx2fc: adapter_lookup: hba NULL > >> lldpad: page allocation failure. order:0, mode:0x4120 > >> Pid: 4556, comm: lldpad Not tainted 2.6.32-639.el6.i686.debug #1 > >> Call Trace: > >> [] ? printk+0x19/0x23 > >> [] ? __alloc_pages_nodemask+0x664/0x830 > >> [] ? free_object+0x82/0xa0 > >> [] ? ixgbe_alloc_rx_buffers+0x10b/0x1d0 [ixgbe] > >> [] ? ixgbe_configure_rx_ring+0x29f/0x420 [ixgbe] > >> [] ? ixgbe_configure_tx_ring+0x15c/0x220 [ixgbe] > >> [] ? ixgbe_configure+0x589/0xc00 [ixgbe] > >> [] ? ixgbe_open+0xa7/0x5c0 [ixgbe] > >> [] ? ixgbe_init_interrupt_scheme+0x5b6/0x970 [ixgbe] > >> [] ? ixgbe_setup_tc+0x1a4/0x260 [ixgbe] > >> [] ? ixgbe_dcbnl_set_state+0x7f/0x90 [ixgbe] > >> [] ? dcb_doit+0x10ed/0x16d0 > >> ... > > > > > > Well, maybe this call site (via ixgbe_configure_rx_ring()) should be > > using GFP_KERNEL instead of GFP_ATOMIC. > > The problem is the ixgbe driver is using the same function for > allocating memory in the softirq and in the init. As such it has to > default to GFP_ATOMIC so that it doesn't screw up the NAPI allocation > case. > I suppose a happy medium would be to extend dev_alloc_pages to accept a gfp argument, and then have the function itself only set __GFP_NOWARN, if ATOMIC is also set? Neil