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

Re: [PATCH v2] x86/vpt: Do not take pt_migrate rwlock in some cases



On 29.03.2021 17:04, Boris Ostrovsky wrote:
> On 3/29/21 5:56 AM, Jan Beulich wrote:
>> On 27.03.2021 02:51, Boris Ostrovsky wrote:
>>> @@ -580,13 +593,22 @@ static void pt_adjust_vcpu(struct periodic_time *pt, 
>>> struct vcpu *v)
>>>          return;
>>>  
>>>      write_lock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
>>> +
>>> +    pt_vcpu_lock(pt->vcpu);
>>> +    if ( pt->on_list )
>>> +        list_del(&pt->list);
>>> +    pt_vcpu_unlock(pt->vcpu);
>> While these two obviously can't use v, ...
>>
>>>      pt->vcpu = v;
>>> +
>>> +    pt_vcpu_lock(pt->vcpu);
>>>      if ( pt->on_list )
>>>      {
>>> -        list_del(&pt->list);
>>>          list_add(&pt->list, &v->arch.hvm.tm_list);
>>>          migrate_timer(&pt->timer, v->processor);
>>>      }
>>> +    pt_vcpu_unlock(pt->vcpu);
>> ... these two again could (and imo should), and ...
>>
>>>      write_unlock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
>> ... really this and its counterpart better would do so, too (albeit
>> perhaps in a separate patch).
> 
> 
> Are you suggesting to replace pt->vcpu with v here?

Yes.

> They are different at lock and unlock points (although they obviously point 
> to the same domain).

Indeed, but all we care about is - as you say - the domain.

Jan



 


Rackspace

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