xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: Keir Fraser <keir.xen@gmail.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] Allow ACPI state change with active cpupools
Date: Wed, 21 Mar 2012 14:46:30 +0100	[thread overview]
Message-ID: <4F69DBB6.2020400@ts.fujitsu.com> (raw)
In-Reply-To: <CB8E4AF9.2ECDC%keir.xen@gmail.com>

On 03/20/2012 03:55 PM, Keir Fraser wrote:
> On 20/03/2012 14:46, "Juergen Gross"<juergen.gross@ts.fujitsu.com>  wrote:
>
>>> Is it better to have cpupools know about offlining/suspend, or have
>>> offlining/suspend know about cpupools? I would have thought the latter makes
>>> more sense since it is offlining/suspend which calls into the cpupool
>>> subsystem.
>> I thought of a more relaxed solution in the cpupool coding:
>>
>> Instead of allowing to offline a cpu only if it is in Pool-0, I would allow it
>> if:
>> - the cpu is not the last one in the cpupool
>> - or no domain is active in the cpupool (this would include the suspend case,
>>     where all domains are paused)
>>
>> Together with your proposal to remember the cpupool for an offlined cpu to add
>> it again when it is onlined the handling should be rather simple and local.
> Ah, I see. Yes, a more flexible policy like this in the cpupool subsystem is
> best solution of all, imo.

I have a problem with that solution. I had to change cpu_disable_scheduler() to
do a vcpu_migrate() only if the vcpu is runnable. When the ACPI state change
isn't permanent like in poweroff case I don't want to change vcpu affinities.
This action might be necessary in vcpu_wake() if v->processor isn't usable for
the vcpu any more.

Unfortunately vcpu_migrate() is calling evtchn_move_pirqs(), which taking the
domain event channel lock. And vcpu_wake() is called at least by send_evtchn()
with that lock already hold...

Is it possible to use spin_lock_recursive() for the domain event channel lock?

Another solution would be to omit the vcpu_migrate() in cpu_disable_scheduler()
for paused vcpus only and to do it when unpausing the vcpu, but this would
leak scheduler internals...


Juergen

-- 
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

      reply	other threads:[~2012-03-21 13:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 12:15 [PATCH] Allow ACPI state change with active cpupools Juergen Gross
2012-03-20 12:52 ` Keir Fraser
2012-03-20 13:35   ` Juergen Gross
2012-03-20 14:30     ` Keir Fraser
2012-03-20 14:46       ` Juergen Gross
2012-03-20 14:55         ` Keir Fraser
2012-03-21 13:46           ` Juergen Gross [this message]

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=4F69DBB6.2020400@ts.fujitsu.com \
    --to=juergen.gross@ts.fujitsu.com \
    --cc=keir.xen@gmail.com \
    --cc=xen-devel@lists.xensource.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).