WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] linux: Adjust memory allocation condition in netback

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux: Adjust memory allocation condition in netback
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Mon, 12 Mar 2007 14:28:03 +0000
Delivery-date: Mon, 12 Mar 2007 07:26:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
.. to reduce memory pressure on Xen and avoid unnecessarily stalling
receives.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux: Adjust memory allocation condition in netback, Jan Beulich <=