rpms/kernel/F-12 linux-2.6-iwlwifi-reduce-noise-when-skb-allocation-fails.patch, NONE, 1.1 kernel.spec, 1.1843, 1.1844

John W. Linville linville at fedoraproject.org
Fri Oct 2 20:07:36 UTC 2009


Author: linville

Update of /cvs/pkgs/rpms/kernel/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12552

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-iwlwifi-reduce-noise-when-skb-allocation-fails.patch 
Log Message:
Backport "iwlwifi: reduce noise when skb allocation fails"

linux-2.6-iwlwifi-reduce-noise-when-skb-allocation-fails.patch:
 iwl-rx.c       |   10 +++++++++-
 iwl3945-base.c |    9 ++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

--- NEW FILE linux-2.6-iwlwifi-reduce-noise-when-skb-allocation-fails.patch ---
Backport of the following upstream commit...

commit f82a924cc88a5541df1d4b9d38a0968cd077a051
Author: Reinette Chatre <reinette.chatre at intel.com>
Date:   Thu Sep 17 10:43:56 2009 -0700

    iwlwifi: reduce noise when skb allocation fails
    
    Replenishment of receive buffers is done in the tasklet handling
    received frames as well as in a workqueue. When we are in the tasklet
    we cannot sleep and thus attempt atomic skb allocations. It is generally
    not a big problem if this fails since iwl_rx_allocate is always followed
    by a call to iwl_rx_queue_restock which will queue the work to replenish
    the buffers at a time when sleeping is allowed.
    
    We thus add the __GFP_NOWARN to the skb allocation in iwl_rx_allocate to
    reduce the noise if such an allocation fails while we still have enough
    buffers. We do maintain the warning and the error message when we are low
    on buffers to communicate to the user that there is a potential problem with
    memory availability on system
    
    This addresses issue reported upstream in thread "iwlagn: order 2 page
    allocation failures" in
    http://thread.gmane.org/gmane.linux.kernel.wireless.general/39187
    
    Signed-off-by: Reinette Chatre <reinette.chatre at intel.com>
    Acked-by: Mel Gorman <mel at csn.ul.ie>
    Signed-off-by: John W. Linville <linville at tuxdriver.com>

diff -up linux-2.6.31.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c.orig linux-2.6.31.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c
--- linux-2.6.31.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c.orig	2009-10-02 15:40:48.000000000 -0400
+++ linux-2.6.31.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c	2009-10-02 15:53:01.000000000 -0400
@@ -1211,13 +1211,20 @@ static void iwl3945_rx_allocate(struct i
 		list_del(element);
 		spin_unlock_irqrestore(&rxq->lock, flags);
 
+		if (rxq->free_count > RX_LOW_WATERMARK)
+			priority |= __GFP_NOWARN;
 		/* Alloc a new receive buffer */
 		rxb->skb =
 		    alloc_skb(priv->hw_params.rx_buf_size,
 				priority);
 		if (!rxb->skb) {
 			if (net_ratelimit())
-				IWL_CRIT(priv, ": Can not allocate SKB buffers\n");
+				IWL_DEBUG_INFO(priv, "Failed to allocate SKB buffer.\n");
+			if ((rxq->free_count <= RX_LOW_WATERMARK) &&
+			    net_ratelimit())
+				IWL_CRIT(priv, "Failed to allocate SKB buffer with %s. Only %u free buffers remaining.\n",
+					 priority == GFP_ATOMIC ?  "GFP_ATOMIC" : "GFP_KERNEL",
+					 rxq->free_count);
 			/* We don't reschedule replenish work here -- we will
 			 * call the restock method and if it still needs
 			 * more buffers it will schedule replenish */
diff -up linux-2.6.31.noarch/drivers/net/wireless/iwlwifi/iwl-rx.c.orig linux-2.6.31.noarch/drivers/net/wireless/iwlwifi/iwl-rx.c
--- linux-2.6.31.noarch/drivers/net/wireless/iwlwifi/iwl-rx.c.orig	2009-09-09 18:13:59.000000000 -0400
+++ linux-2.6.31.noarch/drivers/net/wireless/iwlwifi/iwl-rx.c	2009-10-02 15:58:34.000000000 -0400
@@ -254,12 +254,20 @@ void iwl_rx_allocate(struct iwl_priv *pr
 
 		spin_unlock_irqrestore(&rxq->lock, flags);
 
+		if (rxq->free_count > RX_LOW_WATERMARK)
+			priority |= __GFP_NOWARN;
 		/* Alloc a new receive buffer */
 		rxb->skb = alloc_skb(priv->hw_params.rx_buf_size + 256,
 						priority);
 
 		if (!rxb->skb) {
-			IWL_CRIT(priv, "Can not allocate SKB buffers\n");
+			if (net_ratelimit())
+				IWL_DEBUG_INFO(priv, "Failed to allocate SKB buffer.\n");
+			if ((rxq->free_count <= RX_LOW_WATERMARK) &&
+			    net_ratelimit())
+				IWL_CRIT(priv, "Failed to allocate SKB buffer with %s. Only %u free buffers remaining.\n",
+					 priority == GFP_ATOMIC ?  "GFP_ATOMIC" : "GFP_KERNEL",
+					 rxq->free_count);
 			/* We don't reschedule replenish work here -- we will
 			 * call the restock method and if it still needs
 			 * more buffers it will schedule replenish */


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-12/kernel.spec,v
retrieving revision 1.1843
retrieving revision 1.1844
diff -u -p -r1.1843 -r1.1844
--- kernel.spec	30 Sep 2009 19:12:04 -0000	1.1843
+++ kernel.spec	2 Oct 2009 20:07:35 -0000	1.1844
@@ -673,6 +673,7 @@ Patch683: linux-2.6-iwlwifi-fix-debugfs-
 Patch684: linux-2.6-iwlwifi-traverse-linklist-to-find-the-valid-OTP-block.patch
 Patch685: linux-2.6-iwlwifi-fix-unloading-driver-while-scanning.patch
 Patch686: linux-2.6-iwlwifi-remove-deprecated-6000-series-adapters.patch
+Patch687: linux-2.6-iwlwifi-reduce-noise-when-skb-allocation-fails.patch
 
 Patch700: linux-2.6.31-nx-data.patch
 Patch701: linux-2.6.31-modules-ro-nx.patch
@@ -1325,6 +1326,7 @@ ApplyPatch linux-2.6-iwlwifi-update-1000
 ApplyPatch linux-2.6-iwlwifi-fix-debugfs-buffer-handling.patch
 ApplyPatch linux-2.6-iwlwifi-traverse-linklist-to-find-the-valid-OTP-block.patch
 ApplyPatch linux-2.6-iwlwifi-fix-unloading-driver-while-scanning.patch
+ApplyPatch linux-2.6-iwlwifi-reduce-noise-when-skb-allocation-fails.patch
 
 # remove support for deprecated iwl6000 parts
 ApplyPatch linux-2.6-iwlwifi-remove-deprecated-6000-series-adapters.patch
@@ -2075,6 +2077,9 @@ fi
 # and build.
 
 %changelog
+* Fri Oct  2 2009 John W. Linville <linville at redhat.com>
+- Backport "iwlwifi: reduce noise when skb allocation fails"
+
 * Wed Sep 30 2009 David Woodhouse <David.Woodhouse at intel.com>
 - Update IOMMU code; mostly a bunch more workarounds for broken BIOSes.
 




More information about the fedora-extras-commits mailing list