kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junaid Shahid <junaids@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Cc: jmattson@google.com, seanjc@google.com, bgardon@google.com,
	dmatlack@google.com
Subject: Re: [PATCH] kvm: x86: mmu: Make NX huge page recovery period configurable
Date: Mon, 18 Oct 2021 11:55:28 -0700	[thread overview]
Message-ID: <0a192000-23bf-2021-1714-96fc7104ad95@google.com> (raw)
In-Reply-To: <f513e90b-8eed-53ef-6c80-e588f1260e18@redhat.com>

On 10/16/21 12:00 AM, Paolo Bonzini wrote:
> On 16/10/21 02:50, Junaid Shahid wrote:
>> Currently, the NX huge page recovery thread wakes up every minute and
>> zaps 1/nx_huge_pages_recovery_ratio of the total number of split NX
>> huge pages at a time. This is intended to ensure that only a
>> relatively small number of pages get zapped at a time. But for very
>> large VMs (or more specifically, VMs with a large number of
>> executable pages), a period of 1 minute could still result in this
>> number being too high (unless the ratio is changed significantly,
>> but that can result in split pages lingering on for too long).
>>
>> This change makes the period configurable instead of fixing it at
>> 1 minute (though that is still kept as the default). Users of
>> large VMs can then adjust both the ratio and the period together to
>> reduce the number of pages zapped at one time while still
>> maintaining the same overall duration for cycling through the
>> entire list (e.g. the period could be set to 1 second and the ratio
>> to 3600 to maintain the overall cycling period of 1 hour).
> 
> The patch itself looks good, but perhaps the default (corresponding to a period of 0) could be 3600000 / ratio, so that it's enough to adjust the ratio?
> 
> Paolo
> 

Sure, that sounds good. I'll send an updated version.

Thanks,
Junaid

      reply	other threads:[~2021-10-18 18:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-16  0:50 [PATCH] kvm: x86: mmu: Make NX huge page recovery period configurable Junaid Shahid
2021-10-16  7:00 ` Paolo Bonzini
2021-10-18 18:55   ` Junaid Shahid [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=0a192000-23bf-2021-1714-96fc7104ad95@google.com \
    --to=junaids@google.com \
    --cc=bgardon@google.com \
    --cc=dmatlack@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --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;
as well as URLs for NNTP newsgroup(s).