kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@misterjones.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: tglx@linutronix.de, pbonzini@redhat.com, kvm@vger.kernel.org,
	Davidlohr Bueso <dbueso@suse.de>,
	peterz@infradead.org, torvalds@linux-foundation.org,
	bigeasy@linutronix.de, linux-kernel@vger.kernel.org,
	rostedt@goodmis.org, linux-mips@vger.kernel.org,
	Paul Mackerras <paulus@ozlabs.org>,
	joel@joelfernandes.org, will@kernel.org,
Subject: Re: [PATCH 4/5] kvm: Replace vcpu->swait with rcuwait
Date: Wed, 22 Apr 2020 11:14:28 +0100	[thread overview]
Message-ID: <a6e848e46f3c865f6b9d2771c8aad37a@misterjones.org> (raw)
In-Reply-To: <20200422040739.18601-5-dave@stgolabs.net>

On 2020-04-22 05:07, Davidlohr Bueso wrote:
> The use of any sort of waitqueue (simple or regular) for
> wait/waking vcpus has always been an overkill and semantically
> wrong. Because this is per-vcpu (which is blocked) there is
> only ever a single waiting vcpu, thus no need for any sort of
> queue.
> As such, make use of the rcuwait primitive, with the following
> considerations:
>   - rcuwait already provides the proper barriers that serialize
>   concurrent waiter and waker.
>   - Task wakeup is done in rcu read critical region, with a
>   stable task pointer.
>   - Because there is no concurrency among waiters, we need
>   not worry about rcuwait_wait_event() calls corrupting
>   the wait->task. As a consequence, this saves the locking
>   done in swait when modifying the queue. This also applies
>   to per-vcore wait for powerpc kvm-hv.
> The x86 tscdeadline_latency test mentioned in 8577370fb0cb
> ("KVM: Use simple waitqueue for vcpu->wq") shows that, on avg,
> latency is reduced by around 15-20% with this change.
> Cc: Paul Mackerras <paulus@ozlabs.org>
> Cc: kvmarm@lists.cs.columbia.edu
> Cc: linux-mips@vger.kernel.org
> Signed-off-by: Davidlohr Bueso <dbueso@suse.de>

Reviewed-by: Marc Zyngier <maz@kernel.org>


Who you jivin' with that Cosmik Debris?

  parent reply	other threads:[~2020-04-22 10:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22  4:07 [PATCH v3 -tip 0/5] kvm: Use rcuwait for vcpu blocking Davidlohr Bueso
2020-04-22  4:07 ` [PATCH 1/5] rcuwait: Fix stale wake call name in comment Davidlohr Bueso
2020-04-22  4:07 ` [PATCH 2/5] rcuwait: Let rcuwait_wake_up() return whether or not a task was awoken Davidlohr Bueso
2020-04-22  4:07 ` [PATCH 3/5] rcuwait: Introduce prepare_to and finish_rcuwait Davidlohr Bueso
2020-04-23  9:23   ` Peter Zijlstra
2020-04-22  4:07 ` [PATCH 4/5] kvm: Replace vcpu->swait with rcuwait Davidlohr Bueso
2020-04-22  8:32   ` Paolo Bonzini
2020-04-22 10:14   ` Marc Zyngier [this message]
2020-04-23  8:41   ` Marc Zyngier
2020-04-23  8:57     ` Paolo Bonzini
2020-04-23  9:19       ` Peter Zijlstra
2020-04-23  9:26         ` Paolo Bonzini
2020-04-22  4:07 ` [PATCH 5/5] sched/swait: Reword some of the main description Davidlohr Bueso
2020-04-22 11:33 ` [PATCH v3 -tip 0/5] kvm: Use rcuwait for vcpu blocking Peter Zijlstra

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:

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

  git send-email \
    --in-reply-to=a6e848e46f3c865f6b9d2771c8aad37a@misterjones.org \
    --to=maz@misterjones.org \
    --cc=bigeasy@linutronix.de \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=joel@joelfernandes.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paulus@ozlabs.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=will@kernel.org \


* 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;
as well as URLs for NNTP newsgroup(s).