From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: [PATCH 3/4] tmem: drop unnecessary lock in tmem_relinquish_pages() Date: Wed, 30 Apr 2014 16:29:15 -0400 Message-ID: <1398889756-16352-4-git-send-email-konrad.wilk@oracle.com> References: <1398889756-16352-1-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wfb8C-0001eB-Nu for xen-devel@lists.xenproject.org; Wed, 30 Apr 2014 20:29:28 +0000 In-Reply-To: <1398889756-16352-1-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org, andrew.cooper3@citrix.com, jbeulich@suse.com, keir@xen.org Cc: Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org From: Bob Liu 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 Signed-off-by: Konrad Rzeszutek Wilk --- xen/common/tmem.c | 6 ------ 1 file changed, 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; } -- 1.8.5.3