xen: sched: introduce 'adjust_affinity' hook.
authorDario Faggioli <dfaggioli@suse.com>
Wed, 21 Mar 2018 17:17:44 +0000 (17:17 +0000)
committerGeorge Dunlap <george.dunlap@citrix.com>
Wed, 21 Mar 2018 17:19:08 +0000 (17:19 +0000)
commit00060f81eee3b93ec1848cccb673b337e7e6d859
treee22637af5021e782fa4e83db54a865cd19ec339e
parentbde2870e7da1896b36d5117d307a8ac2f07ae276
xen: sched: introduce 'adjust_affinity' hook.

For now, just as a way to give a scheduler an "heads up",
about the fact that the affinity changed.

This enables some optimizations, such as pre-computing
and storing (e.g., in flags) facts like a vcpu being
exclusively pinned to a pcpu, or having or not a
soft affinity. I.e., conditions that, despite the fact
that they rarely change, are right now checked very
frequently, even in hot paths.

Note that, as we expect many scheduler specific
implementations of the adjust_affinity hook to do
something with the per-scheduler vCPU private data,
this commit moves the calls to sched_set_affinity()
after that is allocated (in sched_init_vcpu()).

Note also that this, in future, may turn out as a useful
mean for, e.g., having the schedulers vet, ack or nack
the changes themselves.

Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/dom0_build.c
xen/common/schedule.c
xen/include/xen/sched-if.h
xen/include/xen/sched.h