From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juergen Gross Subject: Re: [PATCH 2 of 2] Avoid vcpu migration of paused vcpus Date: Thu, 22 Mar 2012 12:59:45 +0100 Message-ID: <4F6B1431.508@ts.fujitsu.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2004898900769669236==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Keir Fraser Cc: xen-devel@lists.xensource.com, Jan Beulich List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --===============2004898900769669236== Content-Type: multipart/alternative; boundary="------------060402050208060006040403" This is a multi-part message in MIME format. --------------060402050208060006040403 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 03/22/2012 12:20 PM, Keir Fraser wrote: > On 22/03/2012 10:22, "Juergen Gross" wrote: > >> On 03/22/2012 11:12 AM, Keir Fraser wrote: >>> Your original patch didn't touch this code. Was that an omission in the >>> original version? On reflection I prefer your original patch to this new >>> approach. I'll apply it if you still believe your original patch is complete >>> and correct as it stands. >> I like my second patch more :-) >> >> It covers more cases, not just poweroff. In hibernate case no vcpu pinnings >> will be lost. Today all vcpus pinned to a cpu other than 0 will lose their >> pinnings at cpu offlining. At reactivation those pinnings will not be >> restored automatically. My patch will cover that by checking availability >> of the cpus after reactivation. >> >> Poweroff (which was my primary concern) works with both versions. I did not >> test other ACPI state changes with either version, but would expect better >> results in hibernate case with my second approach. > How about the attached patch? Which is similar to your original patch except > I added the global state variable, and I added a check for it to > cpu_disable_scheduler(). It's nice and small. :-) And it works in all of my test cases for poweroff. :-) Acked-by: Juergen Gross Thanks, Juergen > -- Keir > >> Juergen >> >>> -- Keir >>> >>> On 22/03/2012 08:22, "Juergen Gross" wrote: >>> >>>> Currently offlining a cpu will migrate all vcpus which were active on that >>>> cpu to another one, possibly breaking existing cpu affinities. >>>> >>>> In case of an ACPI state change the cpus are taken offline and online later >>>> (if not poweroff) while all domains are paused. There is no reason to >>>> migrate the vcpus during offlining the cpus, as the cpus will be available >>>> again when the domains are being unpaused. >>>> >>>> This patch defers the migration check in case of paused vcpus or domains >>>> by adding vcpu_arouse() to wake up a vcpu and check whether it must be >>>> migrated to another cpu. >>>> >>>> Signed-off-by: Juergen Gross >>>> >>>> >>>> 3 files changed, 64 insertions(+), 24 deletions(-) >>>> xen/common/domain.c | 4 +- >>>> xen/common/schedule.c | 83 >>>> ++++++++++++++++++++++++++++++++++------------- >>>> xen/include/xen/sched.h | 1 >>>> >>>> >>>> _______________________________________________ >>>> Xen-devel mailing list >>>> Xen-devel@lists.xen.org >>>> http://lists.xen.org/xen-devel >>> >>> _______________________________________________ >>> Xen-devel mailing list >>> Xen-devel@lists.xen.org >>> http://lists.xen.org/xen-devel >>> >>> > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel -- Juergen Gross Principal Developer Operating Systems PDG ES&S SWE OS6 Telephone: +49 (0) 89 3222 2967 Fujitsu Technology Solutions e-mail: juergen.gross@ts.fujitsu.com Domagkstr. 28 Internet: ts.fujitsu.com D-80807 Muenchen Company details: ts.fujitsu.com/imprint.html --------------060402050208060006040403 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 03/22/2012 12:20 PM, Keir Fraser wrote:
On 22/03/2012 10:22, "Juergen Gross" <juergen.gross@ts.fujitsu.com> wrote:

On 03/22/2012 11:12 AM, Keir Fraser wrote:
Your original patch didn't touch this code. Was that an omission in the
original version? On reflection I prefer your original patch to this new
approach. I'll apply it if you still believe your original patch is complete
and correct as it stands.
I like my second patch more :-)

It covers more cases, not just poweroff. In hibernate case no vcpu pinnings
will be lost. Today all vcpus pinned to a cpu other than 0 will lose their
pinnings at cpu offlining. At reactivation those pinnings will not be
restored automatically. My patch will cover that by checking availability
of the cpus after reactivation.

Poweroff (which was my primary concern) works with both versions. I did not
test other ACPI state changes with either version, but would expect better
results in hibernate case with my second approach.
How about the attached patch? Which is similar to your original patch except
I added the global state variable, and I added a check for it to
cpu_disable_scheduler(). It's nice and small. :-)

And it works in all of my test cases for poweroff. :-)

Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>


Thanks, Juergen

 -- Keir

Juergen

  -- Keir

On 22/03/2012 08:22, "Juergen Gross"<juergen.gross@ts.fujitsu.com>  wrote:

Currently offlining a cpu will migrate all vcpus which were active on that
cpu to another one, possibly breaking existing cpu affinities.

In case of an ACPI state change the cpus are taken offline and online later
(if not poweroff) while all domains are paused. There is no reason to
migrate the vcpus during offlining the cpus, as the cpus will be available
again when the domains are being unpaused.

This patch defers the migration check in case of paused vcpus or domains
by adding vcpu_arouse() to wake up a vcpu and check whether it must be
migrated to another cpu.

Signed-off-by: Juergen Gross<juergen.gross@ts.fujitsu.com>


3 files changed, 64 insertions(+), 24 deletions(-)
xen/common/domain.c     |    4 +-
xen/common/schedule.c   |   83
++++++++++++++++++++++++++++++++++-------------
xen/include/xen/sched.h |    1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel



      

      
_______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel


-- 
Juergen Gross                 Principal Developer Operating Systems
PDG ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@ts.fujitsu.com
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html
--------------060402050208060006040403-- --===============2004898900769669236== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============2004898900769669236==--