From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ross Lagerwall <ross.lagerwall@citrix.com>, xen-devel@lists.xen.org
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v2] x86/HVM: Avoid cache flush operations during hvm_load
Date: Tue, 2 Jun 2015 13:56:03 +0100 [thread overview]
Message-ID: <556DA7E3.4070500@citrix.com> (raw)
In-Reply-To: <1433249220-23845-1-git-send-email-ross.lagerwall@citrix.com>
On 02/06/15 13:47, Ross Lagerwall wrote:
> An MTRR record is processed for each vCPU during hvm_load. Each MTRR
> record sets several mtrrs, each of which flushes the cache on all pCPUs.
> This can take some time and trip the watchdog for HVM guests with many
> CPUs.
>
> To fix this, introduce a flag which prevents flushing the cache on x86
> while loading the restore records and instead does a single cache flush
> at the end of hvm_load.
>
> This reduces the time to restore an HVM guest with 32 vCPUs by about 5
> seconds on an Intel Xeon CPU E7-2870.
>
> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
> ---
>
> In v2: Code moved into arch hooks since it's x86 specific.
>
> xen/arch/x86/hvm/mtrr.c | 5 +++++
> xen/arch/x86/hvm/save.c | 10 ++++++++++
> xen/common/hvm/save.c | 15 ++++++++++-----
> xen/include/asm-x86/mtrr.h | 9 +++++++++
> xen/include/xen/hvm/save.h | 1 +
> 5 files changed, 35 insertions(+), 5 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
> index a69ee62..f21b367 100644
> --- a/xen/arch/x86/hvm/mtrr.c
> +++ b/xen/arch/x86/hvm/mtrr.c
> @@ -65,6 +65,8 @@ static const uint8_t mm_type_tbl[MTRR_NUM_TYPES][PAT_TYPE_NUMS] = {
> #undef RS
> };
>
> +DEFINE_PER_CPU(bool_t, memory_type_changed_ignore);
Thinking about this, this should be "memory_type_changed_defer" and
there should be a second bool "memory_type_changed_wanted".
This way, we don't suffer a memory_type_changed() in
arch_hvm_load_post() if there were no MTRR records loaded; we support
partial loads of state via this path as well.
~Andrew
next prev parent reply other threads:[~2015-06-02 12:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-02 12:47 [PATCH v2] x86/HVM: Avoid cache flush operations during hvm_load Ross Lagerwall
2015-06-02 12:56 ` Andrew Cooper [this message]
2015-06-02 13:02 ` Jan Beulich
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=556DA7E3.4070500@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=ross.lagerwall@citrix.com \
--cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.