All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Gao <chao.gao@intel.com>
To: Kenta Ishiguro <kentaishiguro@sslab.ics.keio.ac.jp>
Cc: <pbonzini@redhat.com>, <kvm@vger.kernel.org>, <vkuznets@redhat.com>
Subject: Re: [RFC] Para-virtualized TLB flush for PV-waiting vCPUs
Date: Mon, 20 Jan 2025 14:06:28 +0800	[thread overview]
Message-ID: <Z43n5J+a3BPqTBsP@intel.com> (raw)
In-Reply-To: <20250106155652.484001-1-kentaishiguro@sslab.ics.keio.ac.jp>

On Tue, Jan 07, 2025 at 12:56:52AM +0900, Kenta Ishiguro wrote:
>In oversubscribed environments, the latency of flushing the remote TLB can
>become significant when the destination virtual CPU (vCPU) is the waiter
>of a para-virtualized queued spinlock that halts with interrupts disabled.
>This occurs because the waiter does not respond to remote function call
>requests until it releases the spinlock. As a result, the source vCPU
>wastes CPU time performing busy-waiting for a response from the
>destination vCPU.
>
>To mitigate this issue, this patch extends the target of the PV TLB flush
>to include vCPUs that are halting to wait on the PV qspinlock. Since the
>PV qspinlock waiters voluntarily yield before being preempted by KVM,
>their state does not get preempted, and the current PV TLB flush overlooks
>them. This change allows vCPUs to bypass waiting for PV qspinlock waiters
>during TLB shootdowns.

This doesn't seem to be a KVM-specific problem; other hypervisors should
have the same problem. So, I think we can implement a more generic solution
w/o involving the hypervisor. e.g., the guest can track which vCPUs are
waiting on PV qspinlock, delay TLB flush on them and have those vCPUs
perform TLB flush after they complete their wait (e.g., right after the
halt() in kvm_wait()).

  parent reply	other threads:[~2025-01-20  6:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-06 15:56 [RFC] Para-virtualized TLB flush for PV-waiting vCPUs Kenta Ishiguro
2025-01-17 21:34 ` Sean Christopherson
2025-01-19 16:27   ` Kenta Ishiguro
2025-01-21 21:35     ` Sean Christopherson
2025-01-20  6:06 ` Chao Gao [this message]
2025-01-21 20:59   ` 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=Z43n5J+a3BPqTBsP@intel.com \
    --to=chao.gao@intel.com \
    --cc=kentaishiguro@sslab.ics.keio.ac.jp \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=vkuznets@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 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.