From: Sean Christopherson <seanjc@google.com>
To: Hao Peng <flyingpenghao@gmail.com>
Cc: pbonzini@redhat.com, kvm@vger.kernel.org, inux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] KVM: x86: Keep the lock order consistent
Date: Fri, 2 Dec 2022 19:23:12 +0000 [thread overview]
Message-ID: <Y4pQoHRWfxGsdOQd@google.com> (raw)
In-Reply-To: <CAPm50a++Cb=QfnjMZ2EnCj-Sb9Y4UM-=uOEtHAcjnNLCAAf-dQ@mail.gmail.com>
On Tue, Nov 08, 2022, Hao Peng wrote:
> From: Peng Hao <flyingpeng@tencent.com>
>
> Acquire SRCU before taking the gpc spinlock in wait_pending_event() so as
> to be consistent with all other functions that acquire both locks. It's
> not illegal to acquire SRCU inside a spinlock, nor is there deadlock
> potential, but in general it's preferable to order locks from least
> restrictive to most restrictive, e.g. if wait_pending_event() needed to
> sleep for whatever reason, it could do so while holding SRCU, but would
> need to drop the spinlock.
>
> Thanks Sean Christopherson for the comment.
>
> Signed-off-by: Peng Hao <flyingpeng@tencent.com>
> Reviewed-by: Sean Christopherson <seanjc@google.com>
> ---
Merged to kvm/queue, thanks!
https://lore.kernel.org/all/Y4lHxds8pvBhxXFX@google.com
prev parent reply other threads:[~2022-12-02 19:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 3:50 [PATCH v3] KVM: x86: Keep the lock order consistent Hao Peng
2022-12-02 19:23 ` Sean Christopherson [this message]
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=Y4pQoHRWfxGsdOQd@google.com \
--to=seanjc@google.com \
--cc=flyingpenghao@gmail.com \
--cc=inux-kernel@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox