Message ID | 20200430151559.1464-4-jgross@suse.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | xen: Fix some bugs in scheduling | expand |
On Thu, 2020-04-30 at 17:15 +0200, Juergen Gross wrote: > Commit cb563d7665f2 ("xen/sched: support core scheduling for moving > cpus to/from cpupools") introduced a regression when trying to remove > an offline cpu from a cpupool, as the system would crash in this > situation. > > Fix that by testing the cpu to be online. > > Fixes: cb563d7665f2 ("xen/sched: support core scheduling for moving > cpus to/from cpupools") > Signed-off-by: Juergen Gross <jgross@suse.com> > Acked-by: Dario Faggioli <dfaggioli@suse.com> Thanks and Regards
On 07.05.2020 20:36, Dario Faggioli wrote: > On Thu, 2020-04-30 at 17:15 +0200, Juergen Gross wrote: >> Commit cb563d7665f2 ("xen/sched: support core scheduling for moving >> cpus to/from cpupools") introduced a regression when trying to remove >> an offline cpu from a cpupool, as the system would crash in this >> situation. >> >> Fix that by testing the cpu to be online. >> >> Fixes: cb563d7665f2 ("xen/sched: support core scheduling for moving >> cpus to/from cpupools") >> Signed-off-by: Juergen Gross <jgross@suse.com> >> > Acked-by: Dario Faggioli <dfaggioli@suse.com> Jürgen, it looks like this is independent of the earlier two patches and hence could go in, while I understand there'll be v2 for the earlier ones. Please confirm. Jan
On 08.05.20 10:19, Jan Beulich wrote: > On 07.05.2020 20:36, Dario Faggioli wrote: >> On Thu, 2020-04-30 at 17:15 +0200, Juergen Gross wrote: >>> Commit cb563d7665f2 ("xen/sched: support core scheduling for moving >>> cpus to/from cpupools") introduced a regression when trying to remove >>> an offline cpu from a cpupool, as the system would crash in this >>> situation. >>> >>> Fix that by testing the cpu to be online. >>> >>> Fixes: cb563d7665f2 ("xen/sched: support core scheduling for moving >>> cpus to/from cpupools") >>> Signed-off-by: Juergen Gross <jgross@suse.com> >>> >> Acked-by: Dario Faggioli <dfaggioli@suse.com> > > Jürgen, > > it looks like this is independent of the earlier two patches > and hence could go in, while I understand there'll be v2 for > the earlier ones. Please confirm. Confirmed. Juergen
diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c index d40345b585..de9e25af84 100644 --- a/xen/common/sched/cpupool.c +++ b/xen/common/sched/cpupool.c @@ -520,6 +520,9 @@ static int cpupool_unassign_cpu(struct cpupool *c, unsigned int cpu) debugtrace_printk("cpupool_unassign_cpu(pool=%d,cpu=%d)\n", c->cpupool_id, cpu); + if ( !cpu_online(cpu) ) + return -EINVAL; + master_cpu = sched_get_resource_cpu(cpu); ret = cpupool_unassign_cpu_start(c, master_cpu); if ( ret )
Commit cb563d7665f2 ("xen/sched: support core scheduling for moving cpus to/from cpupools") introduced a regression when trying to remove an offline cpu from a cpupool, as the system would crash in this situation. Fix that by testing the cpu to be online. Fixes: cb563d7665f2 ("xen/sched: support core scheduling for moving cpus to/from cpupools") Signed-off-by: Juergen Gross <jgross@suse.com> --- xen/common/sched/cpupool.c | 3 +++ 1 file changed, 3 insertions(+)