sched: fix a potential issue with core scheduling
authorJuergen Gross <jgross@suse.com>
Tue, 12 Nov 2019 10:09:11 +0000 (11:09 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Nov 2019 10:09:11 +0000 (11:09 +0100)
commit0aaad752be6d7ac683b0ffba0146ddb9520a877c
treef95bd556d8310da79ea4a4d3e2a1be74ccb92404
parentad591454f069647c36a7daaa9ec23384c0263f0b
sched: fix a potential issue with core scheduling

cpupool_online_cpumask() is used by credit and rt scheduler. It returns
all the cpus of a cpupool or all online cpus in case no cpupool is
specified.

The "no cpupool" case can be dropped, as no scheduler other than the
init scheduler will ever work on cpus not associated with any cpupool.

As the individual schedulers should only ever work on scheduling
resources instead of individual cpus, their cpupool_online_cpumask()
use should be replaced by cpupool->res_valid.

Note that only with core scheduling active this might result in
potential problems, as with cpu scheduling both masks are identical.

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