All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@citrix.com>
To: Dario Faggioli <dario.faggioli@citrix.com>,
	xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Juergen Gross <jgross@suse.com>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v2] xen: sched: fix (ACPI S3) resume with cpupools with different schedulers.
Date: Mon, 7 Dec 2015 12:21:26 +0000	[thread overview]
Message-ID: <566579C6.6080600@citrix.com> (raw)
In-Reply-To: <1448385272.7833.19.camel@citrix.com>

On 24/11/15 17:14, Dario Faggioli wrote:
> On Tue, 2015-11-24 at 15:32 +0000, George Dunlap wrote:
>> On 13/11/15 17:10, Dario Faggioli wrote:
>>>  
>>> During suspend, the pCPUs are not removed from their
>>> pools with the standard procedure (which would involve
>>> schedule_cpu_switch(). During resume, they:
>>>  1) are assigned to the default cpupool (CPU_UP_PREPARE
>>>     phase);
>>>  2) are moved to the pool they were in before suspend,
>>>     via schedule_cpu_switch() (CPU_ONLINE phase)
>>>
>>> During resume, scheduling (even if just the idle loop)
>>> can happen right after the CPU_STARTING phase(before
>>> CPU_ONLINE), i.e., before the pCPU is put back in its
>>> pool.
>>
>> So why are we restoring scheduling stuff during CPU_STARTING, but
>> only
>> putting cpus back in their pools at CPU_ONLINE?
>>
> Indeed. Much worse: we open the CPU for scheduling before it's back in
> its pool (this is all what this bug is about!). this never made much
> sense to me.
> 
>> At some point I think I knew the answer to this, but it's worth
>> revisiting it.
>>
> So, I once had a look, and tried shuffling things around, in a way in
> which the order made more sense to me, but it does not work 'out of the
> box'.
> 
> The issues have, AFAICR, to do with the fact that memory allocations
> (for the per-pCPU scheduling data, need IRQs enabled (which means
> CPU_UP_PREPARE, much rather than CPU_STARTING, is what we want) on the
> scheduling side, and other data that need to be ready and initialized
> in order to setup cpupools (e.g., per_cpu(cpupool, cpu)).
> 
> As said, I don't recall all the details, sorry. I recall thinking that
> a solution would involve putting the CPU in the pool earlier, but that
> in turn calls for other work (e.g., tweaking the priorities of the
> callbacks for avoiding races).
> 
> It's on my list of things to do, but not with super high priority. Are
> you saying that we should drop this patch, and do the callback
> reordering/refactoring first?

Sorry, meant to respond to this -- no, I don't think refactoring is a
prerequisite.  Let me give it another look-over today.

 -George

  reply	other threads:[~2015-12-07 12:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 17:10 [PATCH v2] xen: sched: fix (ACPI S3) resume with cpupools with different schedulers Dario Faggioli
2015-11-16 13:10 ` Juergen Gross
2015-11-24 15:32 ` George Dunlap
2015-11-24 17:14   ` Dario Faggioli
2015-12-07 12:21     ` George Dunlap [this message]
2015-12-10  8:42       ` Dario Faggioli
2015-12-10 15:13 ` George Dunlap

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=566579C6.6080600@citrix.com \
    --to=george.dunlap@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=xen-devel@lists.xenproject.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.