Skip to contentSkip to conversation

linux: Adjust memory allocation condition in netback

PATCH New Jan Beulich 1 participant 1 message Mar 12, 2007 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: Adjust memory allocation condition in netback

.. to reduce memory pressure on Xen and avoid unnecessarily stalling receives.

drivers/xen/netback/netback.c +2 -0
Index: head-2007-02-27/drivers/xen/netback/netback.c
===================================================================
@@ -110,6 +110,7 @@ static unsigned int alloc_index = 0;
 
 static inline unsigned long alloc_mfn(void)
 {
+	BUG_ON(!alloc_index);
 	return mfn_list[--alloc_index];
 }
 
@@ -552,6 +553,7 @@ static void net_rx_action(unsigned long 
 		*(int *)skb->cb = nr_frags;
 
 		if (!xen_feature(XENFEAT_auto_translated_physmap) &&
+		    !((netif_t *)netdev_priv(skb->dev))->copying_receiver &&
 		    check_mfn(nr_frags + 1)) {
 			/* Memory squeeze? Back off for an arbitrary while. */
 			if ( net_ratelimit() )