Jan Beulich
2007-Mar-12 14:28 UTC
[Xen-devel] [PATCH] 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> Index: head-2007-02-27/drivers/xen/netback/netback.c ==================================================================--- head-2007-02-27.orig/drivers/xen/netback/netback.c 2007-03-01 15:23:00.000000000 +0100 +++ head-2007-02-27/drivers/xen/netback/netback.c 2007-03-12 09:26:17.000000000 +0100 @@ -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() ) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel