public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: kvm@vger.kernel.org
Subject: [Bug 219112] Machine will not wake from suspend if KVM VM is running
Date: Tue, 05 Nov 2024 17:44:55 +0000	[thread overview]
Message-ID: <bug-219112-28872-CrbRMPpL9Z@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-219112-28872@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=219112

--- Comment #7 from Sean Christopherson (seanjc@google.com) ---
(In reply to Brandon Nielsen from comment #6)
> (In reply to Sean Christopherson from comment #5)
> > Heh, that was quite the rabbit hole.  Poking around reminded me of a bug
> > report from Tejun about KVM worker threads not freezing in certain
> > scenarios[*].
> > 
> > Long explanation very short, can you try setting KVM's "nx_huge_pages"
> > module param to "never"?  E.g. via
> > 
> >   echo "never" | sudo tee /sys/module/kvm/parameters/nx_huge_pages
> > 
> > Note, the module param is writable even while KVM is loaded, but it needs
> to
> > be set to "never' _before_ launching any VMs, in which case KVM won't spawn
> > the associated worker thread.  I.e. the "never" setting only affects worker
> > threads for new VMs.
> > 
> > AFAIK, that's the only problematic flavor of worker thread in KVM.  If that
> > makes the suspend/resume problem go away, then odds are very good the
> > underlying issue is the same one Tejun reported.
> > 
> > [*] https://lore.kernel.org/all/ZyAnSAw34jwWicJl@slm.duckdns.org
> 
> Interesting, so on my Intel laptop that is set to "Y", on my AMD desktop
> that is set to "N", in both cases, setting it to "never" seems to fix
> suspend. I can't find the documentation for that particular tunable, but
> that seems odd.

The behavior is expected and working as intended.  The parameter controls a
mitigation that is enabled by default if and only if the CPU is affected by
L1TF.  But, KVM creates a kthread related to the mitigation even if the
mitigation is disabled, so that KVM doesn't need to try and spawn/destroy the
kthread on-demand if the user/admin toggles the mitigation while the VM is
running.

The "never" setting is a relatively recent addition that allows the admin to
commit to never enabling the mitigation (without reloading KVM), specifically
so that KVM can skip creating the kthread, e.g. to reduce VM creation latency.

As for documentation, I'll add that to the todo list, I simply forgot to add it
when introducing the "never" option.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

      parent reply	other threads:[~2024-11-05 17:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30 21:54 [Bug 219112] New: Machine will not wake from suspend if KVM VM is running bugzilla-daemon
2024-07-31  1:47 ` Sean Christopherson
2024-07-31  1:47 ` [Bug 219112] " bugzilla-daemon
2024-08-10  0:27 ` bugzilla-daemon
2024-11-01 14:21 ` bugzilla-daemon
2024-11-03 19:45 ` bugzilla-daemon
2024-11-05  1:37 ` bugzilla-daemon
2024-11-05 16:45 ` bugzilla-daemon
2024-11-05 17:44 ` bugzilla-daemon [this message]

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=bug-219112-28872-CrbRMPpL9Z@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=kvm@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox