xen: sched: leave CPUs doing tasklet work alone.
authorDario Faggioli <dario.faggioli@citrix.com>
Fri, 15 Jul 2016 14:49:11 +0000 (16:49 +0200)
committerGeorge Dunlap <george.dunlap@citrix.com>
Mon, 18 Jul 2016 16:50:10 +0000 (17:50 +0100)
commitb047f888d4896d0e6cca10fbc996d4f1e1d769b2
treecc10fd349d12d35c3b3dbe340f87ed91c4977561
parentb48be35ac86cd6369124cf06ca3006d086095297
xen: sched: leave CPUs doing tasklet work alone.

In both Credit1 and Credit2, stop considering a pCPU idle,
if the reason why the idle vCPU is being selected, is to
do tasklet work.

Not doing so means that the tickling and load balancing
logic, seeing the pCPU as idle, considers it a candidate
for picking up vCPUs. But the pCPU won't actually pick
up or schedule any vCPU, which would then remain in the
runqueue, which is bad, especially if there were other,
truly idle pCPUs, that could execute it.

The only drawback is that we can't assume that a pCPU is
in always marked as idle when being removed from an
instance of the Credit2 scheduler (csched2_deinit_pdata).
In fact, if we are in stop-machine (i.e., during suspend
or shutdown), the pCPUs are running the stopmachine_tasklet
and hence are actually marked as busy. On the other hand,
when removing a pCPU from a Credit2 pool, it will indeed
be idle. The only thing we can do, therefore, is to
remove the BUG_ON() check.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit.c
xen/common/sched_credit2.c