public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Sean Christopherson <seanjc@google.com>,
	David Matlack <dmatlack@google.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v2] KVM: x86/mmu: Do not recover dirty-tracked NX Huge Pages
Date: Thu, 17 Nov 2022 17:28:41 +0100	[thread overview]
Message-ID: <d636e626-ae33-0119-545d-a0b60cbe0ff7@redhat.com> (raw)
In-Reply-To: <Y2l247/1GzVm4mJH@google.com>

On 11/7/22 22:21, Sean Christopherson wrote:
> 
> Hmm, and the memslot heuristic doesn't address the recovery worker holding mmu_lock
> for write.  On a non-preemptible kernel, rwlock_needbreak() is always false, e.g.
> the worker won't yield to vCPUs that are trying to handle non-fast page faults.
> The worker should eventually reach steady state by unaccounting everything, but
> that might take a while.

I'm not sure what you mean here?  The recovery worker will still 
decrease to_zap by 1 on every unaccounted NX hugepage, and go to sleep 
after it reaches 0.

Also, David's test used a 10-second halving time for the recovery 
thread.  With the 1 hour time the effect would Perhaps the 1 hour time 
used by default by KVM is overly conservative, but 1% over 10 seconds is 
certainly a lot larger an effect, than 1% over 1 hour.

So, I'm queuing the patch.

Paolo

> An alternative idea to the memslot heuristic would be to add a knob to allow
> disabling the recovery thread on a per-VM basis.  Userspace should know that it's
> dirty logging a given VM for migration.


  reply	other threads:[~2022-11-17 16:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 20:44 [PATCH v2] KVM: x86/mmu: Do not recover dirty-tracked NX Huge Pages David Matlack
2022-11-07 21:21 ` Sean Christopherson
2022-11-17 16:28   ` Paolo Bonzini [this message]
2022-11-17 16:39     ` Sean Christopherson
2022-11-17 16:57       ` Paolo Bonzini
2022-11-17 17:03         ` Sean Christopherson
2022-11-17 17:15           ` David Matlack
2022-11-17 19:07             ` 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=d636e626-ae33-0119-545d-a0b60cbe0ff7@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dmatlack@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=seanjc@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox