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] page_alloc: Hold heap_lock while adjustin

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] page_alloc: Hold heap_lock while adjusting page states to/from PGC_state_free.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 15 Sep 2010 07:40:17 -0700
Delivery-date: Wed, 15 Sep 2010 07:43:24 -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 1284394111 -3600
# Node ID 69e8bb164683c76e0cd787df21b98c73905a61e6
# Parent  e300bfa3c0323ac08e7b8cd9fb40f9f1ab548543
page_alloc: Hold heap_lock while adjusting page states to/from PGC_state_free.

This avoids races with buddy-merging logic in free_heap_pages().

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/common/page_alloc.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -r e300bfa3c032 -r 69e8bb164683 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c   Mon Sep 13 17:05:45 2010 +0100
+++ b/xen/common/page_alloc.c   Mon Sep 13 17:08:31 2010 +0100
@@ -415,8 +415,6 @@ static struct page_info *alloc_heap_page
     if ( d != NULL )
         d->last_alloc_node = node;
 
-    spin_unlock(&heap_lock);
-
     cpus_clear(mask);
 
     for ( i = 0; i < (1 << order); i++ )
@@ -437,6 +435,8 @@ static struct page_info *alloc_heap_page
         pg[i].u.inuse.type_info = 0;
         page_set_owner(&pg[i], NULL);
     }
+
+    spin_unlock(&heap_lock);
 
     if ( unlikely(!cpus_empty(mask)) )
     {
@@ -533,6 +533,8 @@ static void free_heap_pages(
     ASSERT(order <= MAX_ORDER);
     ASSERT(node >= 0);
 
+    spin_lock(&heap_lock);
+
     for ( i = 0; i < (1 << order); i++ )
     {
         /*
@@ -560,8 +562,6 @@ static void free_heap_pages(
             pg[i].tlbflush_timestamp = tlbflush_current_time();
     }
 
-    spin_lock(&heap_lock);
-
     avail[node][zone] += 1 << order;
     total_avail_pages += 1 << order;
 

_______________________________________________
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] page_alloc: Hold heap_lock while adjusting page states to/from PGC_state_free., Xen patchbot-unstable <=