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-changelog

[Xen-changelog] [xen-unstable] Serialize scrubbing pages

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Serialize scrubbing pages
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 11 Aug 2008 05:50:55 -0700
Delivery-date: Mon, 11 Aug 2008 05:53:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1218449930 -3600
# Node ID f10d436d9a9ef413135374e73b32659fc2da9cfb
# Parent  3d5515f40b9b2bfee339cc223f891bd5c61d6855
Serialize scrubbing pages

I noticed that parallel scrubbing pages is not efficient
due to spinlock contention. (also memory bandwidth?)
Actually heap_lock becomes a bottleneck.

In my investigation, it often takes 1 millisec just to acquire
the lock on ia64 with 8cpus. It's very wasteful.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
---
 xen/common/page_alloc.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff -r 3d5515f40b9b -r f10d436d9a9e xen/common/page_alloc.c
--- a/xen/common/page_alloc.c   Mon Aug 11 10:52:18 2008 +0100
+++ b/xen/common/page_alloc.c   Mon Aug 11 11:18:50 2008 +0100
@@ -951,10 +951,15 @@ static void page_scrub_softirq(void)
     int               i;
     s_time_t          start = NOW();
 
+    /* free_heap_pages() does not parallelise well. Serialise this function. */
+    if ( !spin_trylock(&page_scrub_lock) )
+    {
+        set_timer(&this_cpu(page_scrub_timer), NOW() + MILLISECS(1));
+        return;
+    }
+
     /* Aim to do 1ms of work every 10ms. */
     do {
-        spin_lock(&page_scrub_lock);
-
         if ( unlikely((ent = page_scrub_list.next) == &page_scrub_list) )
         {
             spin_unlock(&page_scrub_lock);
@@ -973,8 +978,6 @@ static void page_scrub_softirq(void)
         ent->next->prev = &page_scrub_list;
         page_scrub_list.next = ent->next;
         scrub_pages -= (i+1);
-
-        spin_unlock(&page_scrub_lock);
 
         /* Working backwards, scrub each page in turn. */
         while ( ent != &page_scrub_list )
@@ -987,6 +990,8 @@ static void page_scrub_softirq(void)
             free_heap_pages(pfn_dom_zone_type(page_to_mfn(pg)), pg, 0);
         }
     } while ( (NOW() - start) < MILLISECS(1) );
+
+    spin_unlock(&page_scrub_lock);
 
     set_timer(&this_cpu(page_scrub_timer), NOW() + MILLISECS(10));
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Serialize scrubbing pages, Xen patchbot-unstable <=