xen/sched: add scheduler helpers hiding vcpu
authorJuergen Gross <jgross@suse.com>
Fri, 27 Sep 2019 07:00:14 +0000 (09:00 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 27 Sep 2019 13:20:53 +0000 (15:20 +0200)
commite33fad6bf8d5c7aefe3c390416cede4d61452cb5
treea44194824c80edbb06da6dd9ce3fea87ca50f6c7
parent8a04eaa8ea83341b17e502d0dfec564e8f77bfa3
xen/sched: add scheduler helpers hiding vcpu

Add the following helpers using a sched_unit as input instead of a
vcpu:

- is_idle_unit() similar to is_idle_vcpu()
- is_unit_online() similar to is_vcpu_online() (returns true when any
  of its vcpus is online)
- unit_runnable() like vcpu_runnable() (returns true if any of its
  vcpus is runnable)
- sched_set_res() to set the current scheduling resource of a unit
- sched_unit_master() to get the current processor of a unit (returns
  the master_cpu of the scheduling resource of a unit)
- sched_{set|clear}_pause_flags[_atomic]() to modify pause_flags of the
  associated vcpu(s) (modifies the pause_flags of all vcpus of the
  unit)
- sched_idle_unit() to get the sched_unit pointer of the idle vcpu of a
  specific physical cpu

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