From: Keir Fraser References: bnc#638465 --- a/xen/common/page_alloc.c Wed Sep 01 10:22:05 2010 +0100 +++ b/xen/common/page_alloc.c Tue Sep 07 13:55:34 2010 +0100 @@ -378,8 +378,6 @@ total_avail_pages -= request; ASSERT(total_avail_pages >= 0); - spin_unlock(&heap_lock); - cpus_clear(mask); for ( i = 0; i < (1 << order); i++ ) @@ -400,6 +398,8 @@ pg[i].u.inuse.type_info = 0; page_set_owner(&pg[i], NULL); } + + spin_unlock(&heap_lock); if ( unlikely(!cpus_empty(mask)) ) { @@ -496,6 +496,8 @@ ASSERT(order <= MAX_ORDER); ASSERT(node >= 0); + spin_lock(&heap_lock); + for ( i = 0; i < (1 << order); i++ ) { /* @@ -522,8 +524,6 @@ if ( pg[i].u.free.need_tlbflush ) pg[i].tlbflush_timestamp = tlbflush_current_time(); } - - spin_lock(&heap_lock); avail[node][zone] += 1 << order; total_avail_pages += 1 << order;