|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 2/2] xen: merge temporary vcpu pinning scenarios
On 23.07.19 14:42, Jan Beulich wrote: On 23.07.2019 11:20, Juergen Gross wrote:Today there are three scenarios which are pinning vcpus temporarily to a single physical cpu: - NMI/MCE injection into PV domains - wait_event() handling - vcpu_pin_override() handling Each of those cases are handled independently today using their own temporary cpumask to save the old affinity settings.And what guarantees that no two of them will be in use at the same time? You don't even mention ...The three cases can be combined as the two latter cases will only pin a vcpu to the physical cpu it is already running on, while vcpu_pin_override() is allowed to fail... the NMI/#MC injection case here (despite the use of "the two" and "while" giving the impression). Or (looking at the actual code) did you mean "former" instead of "latter"? But if so - id that true? Yes, I meant former. v->processor gets latched into st->processor before raising the softirq, but can't the vCPU be moved elsewhere by the time the softirq handler actually gains control? If that's not possible (and if it's not obvious why, and as you can see it's not obvious to me), then I think a code comment wants to be added there. You are right, it might be possible for the vcpu to move around. OTOH is it really important to run the target vcpu exactly on the cpu it is executing (or has last executed) at the time the NMI/MCE is being queued? This is in no way related to the cpu the MCE or NMI has been happening on. It is just a random cpu, and so it would be if we'd do the cpu selection when the softirq handler is running. One question to understand the idea nehind all that: _why_ is the vcpu pinned until it does an iret? I could understand if it would be pinned to the cpu where the NMI/MCE was happening, but this is not the case. Independent of that introducing new failure cases for vcpu_pin_override() isn't really nice. Then again any two racing/conflicting pinning attempts can't result in anything good. Right. Nevertheless - nice idea, so a few minor comments on the code as well, in the hope that my point above can be addressed. Fine with me. I'd also prefer if you didn't use "tmp" as an infix here. Make it "temporary", "transient", or some such. Perhaps even omit "set", the more that the function may also clear it. Okay.
Yes. Juergen _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |