|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH for 4.5] x86/VPMU: Clear last_vcpu when destroying VPMU
On 12/15/2014 05:07 AM, Jan Beulich wrote: On 12.12.14 at 22:20, <boris.ostrovsky@xxxxxxxxxx> wrote:
If I do simply
if (per_cpu(last_vcpu, vpmu->last_pcpu) == v)
per_cpu(last_vcpu, vpmu->last_pcpu) = NULL
then there is a (rather theoretical) possibility that between the test
and subsequent clearing the remote cpu (i.e. vpmu->last_pcpu) will do
load_vpmu() and then save_vpmu() for another VCPU. The former will clear
last_vcpu and the latter will set last_vcpu to something else. And then
the destroy_vpmu() will set it again to NULL, which is bad.
Doing it in in IPI will guarantee that nothing can happen between test and setting it to NULL. Again, this very much theoretical, but that's why I have it. (BTW, doing this via IPI also preserves assumption that last_vcpu is always updated on local CPU.) My changes for next version would make the need to do the IPIs less frequent. But if last_cpu needs to be cleared it would still be via IPI. -boris _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |