xen/sched: call cpu_disable_scheduler() via cpu notifier
authorJuergen Gross <jgross@suse.com>
Tue, 2 Apr 2019 16:19:05 +0000 (18:19 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 4 Apr 2019 10:10:06 +0000 (11:10 +0100)
commit9b28696502d400832c012c3b3fecfebee6c75648
treeea6bc8d66406eee16148a3ba41db92968ff42dec
parent7f6658d9cb9c11d80f85cc07fdca014938a3457e
xen/sched: call cpu_disable_scheduler() via cpu notifier

cpu_disable_scheduler() is being called from __cpu_disable() today.
There is no need to execute it on the cpu just being disabled, so use
the CPU_DEAD case of the cpu notifier chain. Moving the call out of
stop_machine() context is fine, as we just need to hold the domain RCU
lock and need the scheduler percpu data to be still allocated.

Add another hook for CPU_DOWN_PREPARE to bail out early in case
cpu_disable_scheduler() would fail. This will avoid crashes in rare
cases for cpu hotplug or suspend.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/arm/smpboot.c
xen/arch/x86/smpboot.c
xen/common/schedule.c