]> xenbits.xensource.com Git - xen.git/commit
sched: fix get_cpu_idle_time() with core scheduling
authorJuergen Gross <jgross@suse.com>
Wed, 19 Feb 2020 15:08:11 +0000 (16:08 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 19 Feb 2020 15:08:11 +0000 (16:08 +0100)
commit132cbe8f35632fb2fea0625ee8fdda53a19a1645
treeb3661beaa5ca4394d07da61feb04f95391d2b0e6
parent7ad2164e922ebd7ee1543ba76f971cce22c27dc2
sched: fix get_cpu_idle_time() with core scheduling

get_cpu_idle_time() is calling vcpu_runstate_get() for an idle vcpu.
With core scheduling active this is fragile, as idle vcpus are assigned
to other scheduling units temporarily, and that assignment is changed
in some cases without holding the scheduling lock, and
vcpu_runstate_get() is using v->sched_unit as parameter for
unit_schedule_[un]lock_irq(), resulting in an ASSERT() triggering in
unlock in case v->sched_unit has changed meanwhile.

Fix that by using a local unit variable holding the correct unit.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
xen/common/sched/core.c