From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Anthony Yznaga <anthony.yznaga@oracle.com>
Cc: kvm@vger.kernel.org
Subject: Re: question: KVM_MR_CREATE and kvm_mmu_slot_apply_flags()
Date: Fri, 15 May 2020 16:41:51 -0700 [thread overview]
Message-ID: <20200515234151.GN17572@linux.intel.com> (raw)
In-Reply-To: <7796d7df-9c6b-7f34-6cf4-38607fcfd79b@oracle.com>
On Fri, May 15, 2020 at 02:28:54PM -0700, Anthony Yznaga wrote:
> Hi,
>
> I'm investigating optimizing qemu start time for large memory guests,
> and I'm trying to understand why kvm_mmu_slot_apply_flags() is called by
> kvm_arch_commit_memory_region() for KVM_MR_CREATE. The comments in
> kvm_mmu_slot_apply_flags() imply it should be, but what I've observed is
> that the new slot will have no mappings resulting in slot_handle_level_range()
> walking the rmaps and doing nothing. This can take a noticeable amount of
> time for very large ranges. It doesn't look like there would ever be any
> mappings in a newly created slot. Am I missing something?
I don't think so. I've stared at that call more than once trying to figure
out why it's there. AFAICT, the original code was completely unoptimized,
then the DELETE check got added as the obvious "this is pointless" case.
Note, KVM_MR_MOVE is in the same boat as CREATE; it's basically DELETE+CREATE.
There can theoretically be rmaps for the new/moved memslot, but they should
already be up-to-date since they're consuming the new memslot's properties.
I've always been too scared to remove it and didn't have a strong argument
for doing so :-)
next prev parent reply other threads:[~2020-05-15 23:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-15 21:28 question: KVM_MR_CREATE and kvm_mmu_slot_apply_flags() Anthony Yznaga
2020-05-15 23:41 ` Sean Christopherson [this message]
2020-05-16 0:48 ` Anthony
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=20200515234151.GN17572@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=anthony.yznaga@oracle.com \
--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