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

[Xen-changelog] [xen master] tmem: drop unnecessary lock in tmem_relinquish_pages()



commit 427f62f1804efb0c0ddd0c14b1ca8661292f8b70
Author:     Bob Liu <bob.liu@xxxxxxxxxx>
AuthorDate: Fri May 2 11:46:09 2014 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri May 2 11:46:09 2014 +0200

    tmem: drop unnecessary lock in tmem_relinquish_pages()
    
    CID 1150562
    
    tmem_rwlock is unnecessary in tmem_relinquish_pages(), as
    such lock is used as gate for hypercalls. However
    tmem_relinquish_pages deals with pages that are no longer
    owned by any domain - hence there is no need for tmem_rwlock.
    
    Also the function is protected by the 'heap_lock' which
    is the only calleer of this function.
    
    This patch drops said lock.
    
    Signed-off-by: Bob Liu <bob.liu@xxxxxxxxxx>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 xen/common/tmem.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index f7f828f..f2dc26e 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -2794,9 +2794,6 @@ void *tmem_relinquish_pages(unsigned int order, unsigned 
int memflags)
         return NULL;
     }
 
-    if ( memflags & MEMF_tmem )
-        read_lock(&tmem_rwlock);
-
     while ( (pfp = tmem_page_list_get()) == NULL )
     {
         if ( (max_evictions-- <= 0) || !tmem_evict())
@@ -2812,9 +2809,6 @@ void *tmem_relinquish_pages(unsigned int order, unsigned 
int memflags)
         relinq_pgs++;
     }
 
-    if ( memflags & MEMF_tmem )
-        read_unlock(&tmem_rwlock);
-
     return pfp;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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


 


Rackspace

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