xen: sched: improve checking soft-affinity
authorDario Faggioli <dfaggioli@suse.com>
Wed, 21 Mar 2018 17:17:46 +0000 (17:17 +0000)
committerGeorge Dunlap <george.dunlap@citrix.com>
Wed, 21 Mar 2018 17:19:08 +0000 (17:19 +0000)
commit5e9e3f88fb88fa62b5fc7a9f80d9ef2a95fb0636
treef7ee04a5494ff41d8eb3886eefb18f212d87ce94
parentb37b61d1788292a6a04f31fe3af11dd0f7e826b6
xen: sched: improve checking soft-affinity

The function has_soft_affinity() determines whether the soft-affinity
of a vcpu will have any effect -- that is, whether the affinity will
have any difference, scheduling-wise, from an empty soft-affinity
mask.

Such function takes a custom cpumask as its third parameter for better
flexibility; but that mask is different from the vCPU's hard-affinity
only in one case. Getting rid of that parameter not only simplifies
the function, but enables optimizing the soft affinity check.

It's mostly mechanical, with the exception of
sched_credit.c:_cshed_cpu_pick(), which was the one case where we
passed in something other than the existing hard-affinity.

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