From: Sean Christopherson <seanjc@google.com>
To: Liam Merwick <liam.merwick@oracle.com>
Cc: kvm@vger.kernel.org, pbonzini@redhat.com,
thomas.lendacky@amd.com, michael.roth@amd.com, tabba@google.com,
ackerleytng@google.com
Subject: Re: [PATCH 1/3] KVM: Batch setting of per-page memory attributes to avoid soft lockup
Date: Thu, 5 Jun 2025 12:08:50 -0700 [thread overview]
Message-ID: <aEHrQpvN8CtES9je@google.com> (raw)
In-Reply-To: <03b2e404-afa7-4b12-bcc8-ffea92fe088b@oracle.com>
On Thu, Jun 05, 2025, Liam Merwick wrote:
> On 05/06/2025 16:57, Sean Christopherson wrote:
> > On Thu, Jun 05, 2025, Liam Merwick wrote:
> > > Limit the range of memory per operation when setting the attributes to
> > > avoid holding kvm->slots_lock for too long and causing a cpu soft lockup.
> >
> > Holding slots_lock is totally fine. Presumably the issue is that the CPU never
> > reschedules.
> >
> > E.g. I would expect this to make the problem go away, though it's probably not a
> > complete fix (I'm guessing kvm_range_has_memory_attributes() can be made to yell
> > too).
>
> That indeed works. I couldn't trigger anything in
> kvm_range_has_memory_attributes() but am limited to about 2TiB. I'll do some
> more tracing before I send a v2 to see if there any more places that might be
> close to hitting the limit.
To get kvm_range_has_memory_attributes() to fail, I _think_ you would need to do
a large query when the attributes match a non-zero value, so that it needs to
perform its slower search.
Ah, actually, I wouldn't be at all surprised if the issue is limited to insertion,
or even just to the xa_reserve() path that allocates memory.
next prev parent reply other threads:[~2025-06-05 19:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 15:24 [PATCH 0/3] SEV-SNP fix for cpu soft lockup on 1TB+ guests Liam Merwick
2025-06-05 15:25 ` [PATCH 1/3] KVM: Batch setting of per-page memory attributes to avoid soft lockup Liam Merwick
2025-06-05 15:57 ` Sean Christopherson
2025-06-05 19:03 ` Liam Merwick
2025-06-05 19:08 ` Sean Christopherson [this message]
2025-06-07 21:14 ` Liam Merwick
2025-06-05 15:25 ` [PATCH 2/3] KVM: Add trace_kvm_vm_set_mem_attributes() Liam Merwick
2025-06-05 15:25 ` [PATCH 3/3] KVM: fix typo in kvm_vm_set_mem_attributes() comment Liam Merwick
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=aEHrQpvN8CtES9je@google.com \
--to=seanjc@google.com \
--cc=ackerleytng@google.com \
--cc=kvm@vger.kernel.org \
--cc=liam.merwick@oracle.com \
--cc=michael.roth@amd.com \
--cc=pbonzini@redhat.com \
--cc=tabba@google.com \
--cc=thomas.lendacky@amd.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.