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

[PATCH v3 2/2] x86/vpt: Simplify locking argument to write_{un}lock


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Date: Mon, 29 Mar 2021 17:15:02 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ivlZR+JN8fPCmMqrrPDqj0Vqn0pzdwEdR9x+/IBM4g8=; b=Ge9NzWdV1aavrOFdGJNHeim2UkPqMgyJiKyHwr2ikQJTrNgwtkERNF0ZzywBn/QdSLWJHpwf5kob1+1FZED2+965Kq8L21B4SnnvO6Pg5+jHiauJK2/jHU5MqxQAZ2qX5lM8oiQdUmDH2HTgq2a1LKJgOQMzCII0UYAlmAATIWeoyXuKijWi3q/UmWGLq5Vjm9T8YA3EiaGdd2RBL1l5RR0wSNIhjt3b7mCHXXO37JQyjDFcBcIJ1v2uYJWJvW/Gjfp0NAW2T4oPVvuyRZWNDF+vv7Tg5vvmT28zbTAGJzvKSLsx/rz+LyOZe+v38sZqZdZ7C6lVD0ZWBJfwv8J1pw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W1AZhgISStcdkDVTC/CvbFIMZBumE7/TPl5bzOY5Hni9boGkLxnlbru+UHMT+NJYQeXUNYlQ/5Rhf/HgMlH38wgkSyBD+g0rsWVAMXo7BAW+6yfzHchoQQQYF31UcjLVLfspkyXNyduv6pk2JQZ6/pKTCxx0wqG7A9Ux04OSksLOF9rxPPH+7/oHdroXFhW673ZSOo1PbKJL8u1KqBJAc8YRwGqlhiL02fJCByEDH8q93IXx62lV8Hxu9hziay35r+3Lg7m1sOPBQFUD+rhaaqZon1NEXJZ8QtTpxv7+tlZp9rHCyapAIL1SF93iB+Zl106xyS5HzUYlJBYSBKeIgQ==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=oracle.com;
  • Cc: jbeulich@xxxxxxxx, andrew.cooper3@xxxxxxxxxx, roger.pau@xxxxxxxxxx, wl@xxxxxxx, boris.ostrovsky@xxxxxxxxxx, stephen.s.brennan@xxxxxxxxxx, iwj@xxxxxxxxxxxxxx
  • Delivery-date: Mon, 29 Mar 2021 21:15:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Make both create_periodic_time() and pt_adjust_vcpu() call
write_{un}lock with similar arguments.

Requested-by: Jan Beulich <jbeulich@xxxxxxxx>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
---
New patch.

I ended up doing what Jan asked --- create_periodic_time() is also using 
different
start pointers in lock() and unlock().


 xen/arch/x86/hvm/vpt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 560fab9cfc60..4cc0a0848bd7 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -592,7 +592,7 @@ static void pt_adjust_vcpu(struct periodic_time *pt, struct 
vcpu *v)
     if ( pt->vcpu == NULL )
         return;
 
-    write_lock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
+    write_lock(&v->domain->arch.hvm.pl_time->pt_migrate);
 
     if ( pt->vcpu == v )
         goto out;
@@ -613,7 +613,7 @@ static void pt_adjust_vcpu(struct periodic_time *pt, struct 
vcpu *v)
     pt_vcpu_unlock(v);
 
  out:
-    write_unlock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
+    write_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
 }
 
 void pt_adjust_global_vcpu_target(struct vcpu *v)
-- 
1.8.3.1




 


Rackspace

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