xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] xen: sched/cpupool: more fixing of (corner?) cases
@ 2015-07-03 15:49 Dario Faggioli
  2015-07-03 15:49 ` [PATCH 1/4] xen: sched: factor the code for taking two runq locks in a function Dario Faggioli
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Dario Faggioli @ 2015-07-03 15:49 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap, Juergen Gross

More specifically, this time, of cases when we try to shut the system down or
suspend it in the following situations:
 - when the boot cpu (i.e., most of the times, cpu 0) is not assigned to any
   cpupool,
 - when a (non default) cpupool only has one cpu (and that is not the boot
   cpu).

In both these cases, Xen is crashing, without this series. The splats are in
the changelogs of the relevant patches in the series.

The core of the fix is recognising that cpu_disable_scheduler() is, right now,
serving two purposes, and hence being called from the respective relevant code
path: (1) when a cpu is removed from a pool, and (2) during teardown of a cpu,
for shutdown or suspend.
In its turn, cpu_disable_scheduler() calls the scheduler to make the vcpus go
away from the cpu that is either being removed or is going offline.
Well, while in the former case (cpupool manipulation) that works fine, and is
the right thing to do, in the latter (shutdown or suspend), it just can't
work... And in fact we Oops! :-/

In fact, when the final goal is to move all the vcpus to the boot cpu (as that
is the only one that is not actually going offline, or at least is doing so in
a special way), if the boot cpu is not a possible choice for the scheduler,
well, things simply can't work.
Therefore, in this series (more specifically, in patch 3),
cpu_disable_scheduler() is changed in such a way that the two use cases it
serves are better identified, isolated and handled properly.

About other patches: 1 and 2 are preparatory changes for 3, and they're pure
code motion and refactoring.
Patch 4 fixes another crash, and makes the code look a bit better, in terms of
improved simmetry between the operations of removing and adding a cpu to a
cpupool.[*]

Thanks and Regards,
Dario

[*] Note that this was attempted already, but in the wrong way, and hence such
change was then reverted. Now it's correct (and necessary!). See the changelog
for more details.
---
Dario Faggioli (4):
      xen: sched: factor the code for taking two runq locks in a function
      xen: sched: factor code that moves a vcpu to a new pcpu in a function
      xen: sched: reorganize cpu_disable_scheduler()
      xen: sched/cpupool: properly update affinity when removing a cpu from a cpupool

 xen/common/cpupool.c  |   18 ++++
 xen/common/schedule.c |  222 ++++++++++++++++++++++++++++++++++++-------------
 2 files changed, 179 insertions(+), 61 deletions(-)
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2015-07-15 15:07 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-03 15:49 [PATCH 0/4] xen: sched/cpupool: more fixing of (corner?) cases Dario Faggioli
2015-07-03 15:49 ` [PATCH 1/4] xen: sched: factor the code for taking two runq locks in a function Dario Faggioli
2015-07-08 14:47   ` George Dunlap
2015-07-03 15:49 ` [PATCH 2/4] xen: sched: factor code that moves a vcpu to a new pcpu " Dario Faggioli
2015-07-08 14:56   ` George Dunlap
2015-07-08 15:09     ` Dario Faggioli
2015-07-03 15:49 ` [PATCH 3/4] xen: sched: reorganize cpu_disable_scheduler() Dario Faggioli
2015-07-07 11:16   ` Juergen Gross
2015-07-08 15:13     ` Dario Faggioli
2015-07-09 10:24       ` Dario Faggioli
2015-07-09 10:45         ` Juergen Gross
2015-07-15 14:54           ` Dario Faggioli
2015-07-15 15:07             ` Juergen Gross
2015-07-08 16:01   ` George Dunlap
2015-07-08 16:37     ` Dario Faggioli
2015-07-09 10:33       ` George Dunlap
2015-07-03 15:49 ` [PATCH 4/4] xen: sched/cpupool: properly update affinity when removing a cpu from a cpupool Dario Faggioli
2015-07-07 11:30   ` Juergen Gross
2015-07-08 16:19   ` George Dunlap

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