All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com, andrew.cooper3@citrix.com,
	roger.pau@citrix.com, wl@xen.org, boris.ostrovsky@oracle.com,
	stephen.s.brennan@oracle.com, iwj@xenproject.org
Subject: [PATCH v3 2/2] x86/vpt: Simplify locking argument to write_{un}lock
Date: Mon, 29 Mar 2021 17:15:02 -0400	[thread overview]
Message-ID: <1617052502-14181-3-git-send-email-boris.ostrovsky@oracle.com> (raw)
In-Reply-To: <1617052502-14181-1-git-send-email-boris.ostrovsky@oracle.com>

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

Requested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
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



  parent reply	other threads:[~2021-03-29 21:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 21:15 [PATCH v3 0/2] Performance regression due to XSA-336 Boris Ostrovsky
2021-03-29 21:15 ` [PATCH for-4.15 v3 1/2] x86/vpt: Do not take pt_migrate rwlock in some cases Boris Ostrovsky
2021-03-29 21:15 ` Boris Ostrovsky [this message]
2021-03-30  7:36   ` [PATCH v3 2/2] x86/vpt: Simplify locking argument to write_{un}lock Roger Pau Monné
2021-03-30 12:49     ` Jan Beulich
2021-03-30 14:22       ` Boris Ostrovsky
2021-03-30 10:17 ` [PATCH v3 0/2] Performance regression due to XSA-336 Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1617052502-14181-3-git-send-email-boris.ostrovsky@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=stephen.s.brennan@oracle.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.