xen/sched: call cpu_disable_scheduler() via cpu notifier
Quoted 11 lines · Jan Beulich
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 27.03.19 at 17:45, <[email protected]> wrote:
Quoted 8 lines · Jan Beulich
Also while indeed (as the description says) there's no need to run the function on the CPU itself, it's not obvious to me that it's safe to run it outside of
stop_machine()context. Or to be more precise, it's not clear to me that leavingstop_machine()context with the adjustments not done yet is not going to lead to problems (due to the gap between leaving that context and acquiring the RCU lock). Could you clarify this in the description, please (if it indeed is fine this way)?
Quoted 7 lines
Quoted 2 lines
It is fine, as the chances are zero that any code will run on the cpu just taken down and that cpu is not holding any locks we might need.
Well, of course nothing's going to run on that CPU anymore. But vCPU-s may still have associations with it, so what I'm worried about is e.g. something finding
v->processorpointing at an offline CPU and getting confused. Another, more exotic
v->processor is allowed to have a stale value as long as the vcpu isn't running.
Quoted 5 lines
(or should I say contrived) scenario might be a soft-online request coming very quickly after a prior soft-offline one, with this function not having got around to run yet. Or basically anything else that accesses the same state the function means to update (or use).
The CPU_DEAD notifier chain is activated before calling cpu_hotplug_done(). I don't see how an online request could make it in between.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 10 lines · Juergen Gross
Quoted 5 lines · Jan Beulich
Quoted 1 line
Quoted 1 line
Quoted 1 line
Well, of course nothing's going to run on that CPU anymore. But vCPU-s may still have associations with it, so what I'm worried about is e.g. something finding
v->processorpointing at an offline CPU and getting confused. Another, more exotic
v->processoris allowed to have a stale value as long as the vcpu isn't running.
I was also concerned about things being done no longer in stop-machine, like Jan, and in fact, I asked for similar reassurances.
Thinking more about this, I agree with Juergen that it should work. In fact, it's important for v->processor to point to a CPU that has its scheduling data structure allocated and valid.
In current approach, right before suspend, that is only true for the BSP, and that's why we move every vcpu there. But after this series, since we don't deallocate such structs any longer, it should be ok that v->processor retains its value.
Regards,
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Software Engineer @ SUSE https://www.suse.com/
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel