[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3] x86/vpmu: add cpu hot unplug notifier for vpmu



>>> On 23.05.17 at 03:47, <luwei.kang@xxxxxxxxx> wrote:
>> >>> On 21.05.17 at 15:09, <luwei.kang@xxxxxxxxx> wrote:
>> > @@ -394,8 +395,11 @@ int vpmu_load(struct vcpu *v, bool_t from_guest)
>> >      if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
>> >          return 0;
>> >
>> > -    /* First time this VCPU is running here */
>> > -    if ( vpmu->last_pcpu != pcpu )
>> > +    /*
>> > +     * The last pCPU is still online and this is the first time this vCPU
>> > +     * running here.
>> > +     */
>> > +    if ( cpu_online(vpmu->last_pcpu) && vpmu->last_pcpu != pcpu )
>> 
>> Adding a cpu_online() check here is unlikely to be helpful. Actually I may 
> have misguided you with prior comments (and if so, I'm
>> sorry) - the LOADED check following this one makes sure on_selected_cpus() 
> won't be called with an offline CPU here. IOW I think
>> the code can be left untouched, but the reason why should be spelled out in 
> the commit message (matching the reasoning why
>> adding the LOADED check to vpmu_arch_destroy() is sufficient for the second 
> use of last_pcpu there).
>> 
> 
> So, remove cpu_online() check here, because of LOADED check can make sure 
> don't send remote call to an offline cpu (cpu_callback() will
> reset this flag).  
> The cpu_online() check in vpmu_arch_destroy() should be reserved due to 
> per_cpu(last_vcpu, vpmu->last_pcpu) has become an invalid value(Not NULL).
> Is that right?

Yes.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.