All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Fred Griffoul <griffoul@gmail.com>,
	kvm@vger.kernel.org, pbonzini@redhat.com,  vkuznets@redhat.com,
	shuah@kernel.org, linux-kselftest@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	Fred Griffoul <fgriffo@amazon.co.uk>
Subject: Re: [PATCH v4 02/10] KVM: pfncache: Restore guest-uses-pfn support
Date: Thu, 11 Jun 2026 08:55:58 -0700	[thread overview]
Message-ID: <airajin7CpO8HoSF@google.com> (raw)
In-Reply-To: <7428996952122d5943715c8682c6ad1c353566f9.camel@infradead.org>

On Mon, Jun 01, 2026, David Woodhouse wrote:
> On Fri, 2026-01-02 at 14:24 +0000, Fred Griffoul wrote:
> > 
> > @@ -55,6 +70,27 @@ void gfn_to_pfn_cache_invalidate_start(struct kvm *kvm, unsigned long start,
> >  		read_unlock_irq(&gpc->lock);
> >  	}
> >  	spin_unlock(&kvm->gpc_lock);
> > +
> > +	if (evict_vcpus) {
> > +		/*
> > +		 * KVM needs to ensure the vCPU is fully out of guest context
> > +		 * before allowing the invalidation to continue.
> > +		 */
> > +		unsigned int req = KVM_REQ_OUTSIDE_GUEST_MODE;
> > +		bool called;
> > +
> > +		/*
> > +		 * If the OOM reaper is active, then all vCPUs should have
> > +		 * been stopped already, so perform the request without
> > +		 * KVM_REQUEST_WAIT and be sad if any needed to be IPI'd.
> > +		 */
> 
> I am unconvinced of the veracity of that claim. We get here via
> __oom_reap_task_mm() which has explicit comments about 'might start
> racing with the dying task'.
> 
> I think it's actually fine to use KVM_REQUEST_WAIT in theory...

Actually, it has to be "fine", because KVM already does KVM_REQUEST_WAIT for
literally every releavnt OOM kill thanks to the kvm_flush_remote_tlbs() in
kvm_mmu_notifier_invalidate_range_start() -> kvm_handle_hva_range().  So I would
say don't worry about KVM_REQUEST_WAIT here; if we need to fix anything for the
OOM case, then we need a more generic fix.

  reply	other threads:[~2026-06-11 15:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-02 14:24 [PATCH v4 00/10] KVM: nVMX: Improve performance for unmanaged guest memory Fred Griffoul
2026-01-02 14:24 ` [PATCH v4 01/10] KVM: nVMX: Implement cache for L1 MSR bitmap Fred Griffoul
2026-05-11 23:08   ` Sean Christopherson
2026-01-02 14:24 ` [PATCH v4 02/10] KVM: pfncache: Restore guest-uses-pfn support Fred Griffoul
2026-06-01 15:09   ` David Woodhouse
2026-06-11 15:55     ` Sean Christopherson [this message]
2026-01-02 14:24 ` [PATCH v4 03/10] KVM: x86: Add nested state validation for pfncache support Fred Griffoul
2026-01-02 14:24 ` [PATCH v4 04/10] KVM: nVMX: Implement cache for L1 APIC pages Fred Griffoul
2026-05-11 23:35   ` Sean Christopherson
2026-01-02 14:24 ` [PATCH v4 05/10] KVM: selftests: Add nested VMX APIC cache invalidation test Fred Griffoul
2026-01-02 14:24 ` [PATCH v4 06/10] KVM: nVMX: Cache evmcs fields to ensure consistency during VM-entry Fred Griffoul
2026-01-02 15:40   ` Vitaly Kuznetsov
2026-01-02 14:24 ` [PATCH v4 07/10] KVM: nVMX: Replace evmcs kvm_host_map with pfncache Fred Griffoul
2026-01-02 14:24 ` [PATCH v4 08/10] KVM: x86: Add nested context management Fred Griffoul
2026-05-12  0:13   ` Sean Christopherson
2026-01-02 14:24 ` [PATCH v4 09/10] KVM: nVMX: Use nested context for pfncache persistence Fred Griffoul
2026-01-02 14:24 ` [PATCH v4 10/10] KVM: selftests: Add L2 vcpu context switch test Fred Griffoul
2026-05-11 23:56 ` [PATCH v4 00/10] KVM: nVMX: Improve performance for unmanaged guest memory 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=airajin7CpO8HoSF@google.com \
    --to=seanjc@google.com \
    --cc=dwmw2@infradead.org \
    --cc=fgriffo@amazon.co.uk \
    --cc=griffoul@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=shuah@kernel.org \
    --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.