All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "Li, Liang Z" <liang.z.li@intel.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: "Zhang, Yang Z" <yang.z.zhang@intel.com>,
	Tim Deegan <tim@xen.org>, "Tian, Kevin" <kevin.tian@intel.com>,
	"keir@xen.org" <keir@xen.org>,
	"Dong, Eddie" <eddie.dong@intel.com>
Subject: Re: about the funtion call memory_type_changed()
Date: Fri, 16 Jan 2015 10:46:14 +0000	[thread overview]
Message-ID: <54B8EBF6.1080901@citrix.com> (raw)
In-Reply-To: <F2CBF3009FA73547804AE4C663CAB28E46AF21@shsmsx102.ccr.corp.intel.com>

On 16/01/15 10:29, Li, Liang Z wrote:
> Hi Jan,
>
> I found the restore process of the live migration is quit long, so I try to find out what's going on.
> By debugging, I found the most time consuming process is restore the VM's MTRR MSR,
> The process is done in the function hvm_load_mtrr_msr(), it will call the
> memory_type_changed(), which eventually call the time consuming function
> flush_all().
>
> All this is caused by adding the memory_type_changed in your patch, here is the link
> http://lists.xen.org/archives/html/xen-devel/2014-03/msg03792.html,
>
> I am not sure if it's necessary to call flush_all, even it's necessary,  call the function
>  hvm_load_mtrr_msr one time will cause dozens call of flush_all, and each call of the
>  flush_all function will consume about 8 milliseconds, in my test environment, the VM
>  has 4 VCPUs, the hvm_load_mtrr_msr() will be called four times, and totally consumes
>  about 500 milliseconds. Obviously, there are too many flush_all calls.
>
>  I think something should be done to solve this issue, do you think so?

The flush_all() cant be avoided completely, as it is permitted to use
sethvmcontext on an already-running VM.  In this case, the flush
certainly does need to happen if altering the MTRRs has had a real
effect on dirty cache lines.

However, having a batching mechanism across hvm_load_mtrr_msr() with a
single flush at the end seems like a wise move.

~Andrew

  reply	other threads:[~2015-01-16 10:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-16 10:29 about the funtion call memory_type_changed() Li, Liang Z
2015-01-16 10:46 ` Andrew Cooper [this message]
2015-01-16 11:54   ` Jan Beulich
2015-01-16 11:59     ` Andrew Cooper
2015-01-21 10:15     ` Li, Liang Z
2015-01-21 10:31       ` Jan Beulich
2015-01-21 11:14         ` Li, Liang Z
2015-01-21 11:21           ` Jan Beulich
2015-01-22  4:28             ` Li, Liang Z
2015-01-22  5:07               ` Tian, Kevin
2015-01-22  5:15         ` Tian, Kevin
2015-01-22  7:44           ` Zhang, Yang Z
2015-01-22  9:13             ` Jan Beulich
2015-01-23  5:55               ` Li, Liang Z
2015-01-23  6:11                 ` Tian, Kevin

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=54B8EBF6.1080901@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=eddie.dong@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=liang.z.li@intel.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    --cc=yang.z.zhang@intel.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 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.