From: David Woodhouse <dwmw2@infradead.org>
To: David Stevens <stevensd@chromium.org>,
Sean Christopherson <seanjc@google.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] KVM: Support sharing gpc locks
Date: Sun, 29 Jan 2023 11:08:51 +0100 [thread overview]
Message-ID: <2d421cb18dfa1b88e5025f2f9b94e146c0858960.camel@infradead.org> (raw)
In-Reply-To: <20230127044500.680329-2-stevensd@google.com>
[-- Attachment #1: Type: text/plain, Size: 2225 bytes --]
(Resending as the corporate email system has taken to adding redundant
information in transit as an HTML part — to a message that didn't need
it, which already had it in the Organization: header anyway, and was
previously plain text only.)
On Fri, 2023-01-27 at 13:44 +0900, David Stevens wrote:
> @@ -316,19 +316,19 @@ static void kvm_xen_update_runstate_guest(struct kvm_vcpu *v, bool atomic)
> * takes them more than one at a time. Set a subclass on the
> * gpc1 lock to make lockdep shut up about it.
> */
> - lock_set_subclass(&gpc1->lock.dep_map, 1, _THIS_IP_);
> + lock_set_subclass(gpc1->lock.dep_map, 1, _THIS_IP_);
The test robot already pointed out this should be gpc1->lock->dep_map,
but if we do what I said below in the first attempt at this email, this
all goes away anyway.
> if (atomic) {
> - if (!read_trylock(&gpc2->lock)) {
> - read_unlock_irqrestore(&gpc1->lock, flags);
> + if (!read_trylock(gpc2->lock)) {
> + read_unlock_irqrestore(gpc1->lock, flags);
> return;
> }
LGTM without having had time to go through it in detail. As Sean said,
we were waiting for someone (perhaps even ourselves) to do this.
Thanks.
For the runstate one above, this is crying out for gpc1 and gpc2 to
*share* a lock, and ditch the relocking and the whole comment about
being able to declare a lock ordering between the two, which is half
shown in the context cited above.
Probably worth doing that in a separate patch on top of this; I'll take
a look at it when my feet next hit the ground on Tuesday if you haven't
already done so. It's easy to test with the xen_shinfo_test self-test.
Or with this if you want more fun:
https://lore.kernel.org/qemu-devel/20230128081113.1615111-1-dwmw2@infradead.org/
:)
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5965 bytes --]
next prev parent reply other threads:[~2023-01-29 10:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-27 4:44 [PATCH 0/3] KVM: x86: replace kvm_vcpu_map usage in vmx David Stevens
2023-01-27 4:44 ` [PATCH 1/3] KVM: Support sharing gpc locks David Stevens
2023-01-28 21:42 ` kernel test robot
2023-01-29 0:46 ` kernel test robot
2023-01-29 10:08 ` David Woodhouse [this message]
2023-01-30 5:25 ` [PATCH 4/3] KVM: x86/xen: Make runstate cache gpcs share a lock David Stevens
2023-01-31 16:58 ` David Woodhouse
2023-01-27 4:44 ` [PATCH 2/3] KVM: use gfn=>pfn cache in nested_get_vmcs12_pages David Stevens
2023-01-27 4:45 ` [PATCH 3/3] KVM: use gfn=>pfn cache for evmcs David Stevens
2023-01-27 19:19 ` [PATCH 0/3] KVM: x86: replace kvm_vcpu_map usage in vmx Sean Christopherson
2023-03-06 1:45 ` David Stevens
2023-03-07 16:03 ` Sean Christopherson
2023-03-14 23:33 ` Sean Christopherson
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=2d421cb18dfa1b88e5025f2f9b94e146c0858960.camel@infradead.org \
--to=dwmw2@infradead.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=seanjc@google.com \
--cc=stevensd@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®