[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] Revert "mm: don't hold heap lock in alloc_heap_pages() longer than necessary"



commit dfe280c17dbc93c267a9fdf0caa4c0abdd64cd3c
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Aug 30 12:23:23 2017 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Aug 30 12:23:23 2017 +0200

    Revert "mm: don't hold heap lock in alloc_heap_pages() longer than 
necessary"
    
    This reverts commit dab6a84aadab11f31332030a1e9f0b9282d76156,
    as it introduces a race with free_heap_pages().
---
 xen/common/page_alloc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 12e06fd..9fa62d2 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -855,7 +855,6 @@ static struct page_info *alloc_heap_pages(
     struct page_info *pg;
     bool need_tlbflush = false;
     uint32_t tlbflush_timestamp = 0;
-    unsigned int dirty_cnt = 0;
 
     /* Make sure there are enough bits in memflags for nodeID. */
     BUILD_BUG_ON((_MEMF_bits - _MEMF_node) < (8 * sizeof(nodeid_t)));
@@ -944,8 +943,6 @@ static struct page_info *alloc_heap_pages(
     if ( d != NULL )
         d->last_alloc_node = node;
 
-    spin_unlock(&heap_lock);
-
     for ( i = 0; i < (1 << order); i++ )
     {
         /* Reference count must continuously be zero for free pages. */
@@ -955,7 +952,7 @@ static struct page_info *alloc_heap_pages(
         {
             if ( !(memflags & MEMF_no_scrub) )
                 scrub_one_page(&pg[i]);
-            dirty_cnt++;
+            node_need_scrub[node]--;
         }
 
         pg[i].count_info = PGC_state_inuse;
@@ -977,8 +974,6 @@ static struct page_info *alloc_heap_pages(
             check_one_page(&pg[i]);
     }
 
-    spin_lock(&heap_lock);
-    node_need_scrub[node] -= dirty_cnt;
     spin_unlock(&heap_lock);
 
     if ( need_tlbflush )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.