xen: cpupool: add a back-pointer from a scheduler to its pool
authorDario Faggioli <dfaggioli@suse.com>
Thu, 28 May 2020 21:29:37 +0000 (23:29 +0200)
committerGeorge Dunlap <george.dunlap@citrix.com>
Fri, 29 May 2020 17:53:54 +0000 (18:53 +0100)
commit524cc89c288b9ec5ae94f3e9b28a9c460b997cc2
treefa82ba1101d68788a717936f8c1cc21202c327f1
parentc963db8d18e6583d688693ed2e9ca4f15a24c7d9
xen: cpupool: add a back-pointer from a scheduler to its pool

If we need to know within which pool a particular scheduler
is working, we can do that by querying the cpupool pointer
of any of the sched_resource-s (i.e., ~ any of the CPUs)
assigned to the scheduler itself.

Basically, we pick any sched_resource that we know uses that
scheduler, and we check its *cpupool pointer. If we really
know that the resource uses the scheduler, this is fine, as
it also means the resource is inside the pool we are
looking for.

But, of course, we can't do that for a pool/scheduler that has
not any been given any sched_resource yet (or if we do not
know whether or not it has any sched_resource).

To overcome such limitation, add a back pointer from the
scheduler, to its own pool.

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