|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 3/3] xen/cpupool: fix removing cpu from a cpupool
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@xxxxxxxx>
---
xen/common/sched/cpupool.c | 3 +++
1 file changed, 3 insertions(+)
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 )
--
2.16.4
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |