direct-io.hg

changeset 14355:68282f4b3e0f

linux: Adjust memory allocation condition in netback to reduce memory
pressure on Xen and avoid unnecessarily stalling receives.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kfraser@localhost.localdomain
date Mon Mar 12 14:55:02 2007 +0000 (2007-03-12)
parents a4ca6a264fee
children 09da174827ea
files linux-2.6-xen-sparse/drivers/xen/netback/netback.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Mon Mar 12 14:52:11 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Mon Mar 12 14:55:02 2007 +0000
     1.3 @@ -110,6 +110,7 @@ static unsigned int alloc_index = 0;
     1.4  
     1.5  static inline unsigned long alloc_mfn(void)
     1.6  {
     1.7 +	BUG_ON(alloc_index == 0);
     1.8  	return mfn_list[--alloc_index];
     1.9  }
    1.10  
    1.11 @@ -552,6 +553,7 @@ static void net_rx_action(unsigned long 
    1.12  		*(int *)skb->cb = nr_frags;
    1.13  
    1.14  		if (!xen_feature(XENFEAT_auto_translated_physmap) &&
    1.15 +		    !((netif_t *)netdev_priv(skb->dev))->copying_receiver &&
    1.16  		    check_mfn(nr_frags + 1)) {
    1.17  			/* Memory squeeze? Back off for an arbitrary while. */
    1.18  			if ( net_ratelimit() )