public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/2] kvm/x86: vhost task creation failure handling
@ 2025-02-26 21:38 Keith Busch
  2025-02-26 21:38 ` [PATCHv2 1/2] vhost: return task creation error instead of NULL Keith Busch
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Keith Busch @ 2025-02-26 21:38 UTC (permalink / raw)
  To: pbonzini, seanjc, kvm; +Cc: x86, virtualization, linux-kernel, Keith Busch

From: Keith Busch <kbusch@kernel.org>

The suggestion from Sean appears to be successful, so sending out a new
version for consideration.

Background:

The crosvm VMM might send signals to its threads that have entered
KVM_RUN. The signal specifically is SIGRTRMIN from here:

  https://github.com/google/crosvm/blob/main/src/crosvm/sys/linux/vcpu.rs#L651

If this happens to occur when the huge page recovery is trying to create
its vhost task, that will fail with ERESTARTNOINTR. Once this happens,
all KVM_RUN calls will fail with ENOMEM despite memory not being the
problem.

This series propogates the error up so we can distinguish that from the
current defaulting to ENOMEM and replaces the call_once since we need to
be able to call it repeatedly due to this condition.

Changes from the v1 (prefixed as an "RFC", really) patch:

  Instead of using a VM-wide mutex, update the call_once pattern to
  complete only if what it calls is successful (from Sean).

Keith Busch (1):
  vhost: return task creation error instead of NULL

Sean Christopherson (1):
  kvm: retry nx_huge_page_recovery_thread creation

 arch/x86/kvm/mmu/mmu.c    | 12 +++++-------
 drivers/vhost/vhost.c     |  2 +-
 include/linux/call_once.h | 16 +++++++++++-----
 kernel/vhost_task.c       |  4 ++--
 4 files changed, 19 insertions(+), 15 deletions(-)

-- 
2.43.5


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-02-27 15:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-26 21:38 [PATCHv2 0/2] kvm/x86: vhost task creation failure handling Keith Busch
2025-02-26 21:38 ` [PATCHv2 1/2] vhost: return task creation error instead of NULL Keith Busch
2025-02-26 21:38 ` [PATCHv2 2/2] kvm: retry nx_huge_page_recovery_thread creation Keith Busch
2025-02-27 10:21 ` [PATCHv2 0/2] kvm/x86: vhost task creation failure handling Lei Yang
2025-02-27 15:09   ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox