From: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
To: Eric Northup <digitaleric@google.com>
Cc: KVM <kvm@vger.kernel.org>
Subject: Re: [RFC] KVM MMU: improve large munmap efficiency
Date: Fri, 27 Jan 2012 09:59:47 +0900 [thread overview]
Message-ID: <4F21F703.8040000@oss.ntt.co.jp> (raw)
In-Reply-To: <CAG7+5M3BNnnLEOxCEx=L9i4_0pn+0=BsxiXwF_1TjNtOvzxQ5g@mail.gmail.com>
Hi,
(2012/01/27 8:24), Eric Northup wrote:
> Flush the shadow MMU instead of iterating over each host VA when doing
> a large invalidate range callback.
>
> The previous code is O(N) in the number of virtual pages being
> invalidated, while holding both the MMU spinlock and the mmap_sem.
> Large unmaps can cause significant delay, during which the process is
> unkillable. Worse, all page allocation could be delayed if there's
> enough memory pressure that mmu_shrink gets called.
>
> Signed-off-by: Eric Northup<digitaleric@google.com>
>
> ---
>
> We have seen delays of over 30 seconds doing a large (128GB) unmap.
>
> It'd be nicer to check if the amount of work to be done by the entire
> flush is less than the work to be done iterating over each HVA page,
> but that information isn't currently available to the arch-
> independent part of KVM.
Using the number of (active) shadow pages may be one way.
See kvm->arch.n_used_mmu_pages.
>
> Better ideas would be most welcome ;-)
I will soon, this weekend if possible, send a patch series which may
result in speeding up kvm_unmap_hva() loop.
Though my work has been done for optimizing a different thing, dirty
logging, I think this loop will also be optimized.
I have checked that dirty logging improved significantly,
so hope that your case will also.
So, in addition to your patch, please see to what extent my patch series
will help your case, if possible.
Thanks,
Takuya
next prev parent reply other threads:[~2012-01-27 0:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-26 23:24 [RFC] KVM MMU: improve large munmap efficiency Eric Northup
2012-01-27 0:59 ` Takuya Yoshikawa [this message]
2012-01-27 1:13 ` Takuya Yoshikawa
2012-01-29 11:01 ` Avi Kivity
2012-01-29 13:22 ` Takuya Yoshikawa
2012-01-29 13:25 ` Avi Kivity
2012-01-29 13:50 ` Takuya Yoshikawa
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=4F21F703.8040000@oss.ntt.co.jp \
--to=yoshikawa.takuya@oss.ntt.co.jp \
--cc=digitaleric@google.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