xen/sched: build a linked list of struct sched_unit
authorJuergen Gross <jgross@suse.com>
Fri, 27 Sep 2019 07:00:07 +0000 (09:00 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 27 Sep 2019 13:16:53 +0000 (15:16 +0200)
commit141db7fd4d2df79120bebcc3a9746a48d03231f1
tree01fdf30a1eb9a6d755f09460ab714eadf71ea040
parentf9634b2d90b80ae4325d6306862c53e78601f730
xen/sched: build a linked list of struct sched_unit

In order to make it easy to iterate over sched_unit elements of a
domain, build a single linked list and add an iterator for it. The new
list is guarded by the same mechanisms as the vcpu linked list as it
is modified only via vcpu_create() or vcpu_destroy().

For completeness add another iterator for_each_sched_unit_vcpu() which
will iterate over all vcpus of a sched_unit (right now only one). This
will be needed later for larger scheduling granularity (e.g. cores).

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