xen/sched: introduce unit_runnable_state()
authorJuergen Gross <jgross@suse.com>
Wed, 2 Oct 2019 07:27:27 +0000 (09:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 4 Oct 2019 10:54:38 +0000 (12:54 +0200)
commit7c7b407e77724f37c4b448930777a59a479feb21
tree0e6bf622a98691fae8ec370788cb62c5fc6ee986
parentf534bc6821eab925decde843b0d54ccda1cbc510
xen/sched: introduce unit_runnable_state()

Today the vcpu runstate of a new scheduled vcpu is always set to
"running" even if at that time vcpu_runnable() is already returning
false due to a race (e.g. with pausing the vcpu).

With core scheduling this can no longer work as not all vcpus of a
schedule unit have to be "running" when being scheduled. So the vcpu's
new runstate has to be selected at the same time as the runnability of
the related schedule unit is probed.

For this purpose introduce a new helper unit_runnable_state() which
will save the new runstate of all tested vcpus in a new field of the
vcpu struct.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
xen/common/domain.c
xen/common/sched_arinc653.c
xen/common/sched_credit.c
xen/common/sched_credit2.c
xen/common/sched_null.c
xen/common/sched_rt.c
xen/common/schedule.c
xen/include/xen/sched-if.h
xen/include/xen/sched.h