Re: [PATCH] KVM: avoid unnecessary synchronize_rcu

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

 



On 25/08/14 10:24, Christian Borntraeger wrote:
> On 19/08/14 16:45, Christian Borntraeger wrote:
>> We dont have to wait for a grace period if there is no oldpid that
>> we are going to free. putpid also checks for NULL, so this patch
>> only fences synchronize_rcu.
>>
>> Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>
>> ---
>>  virt/kvm/kvm_main.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 33712fb..39b1603 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -129,7 +129,8 @@ int vcpu_load(struct kvm_vcpu *vcpu)
>>  		struct pid *oldpid = vcpu->pid;
>>  		struct pid *newpid = get_task_pid(current, PIDTYPE_PID);
>>  		rcu_assign_pointer(vcpu->pid, newpid);
>> -		synchronize_rcu();
>> +		if (oldpid)
>> +			synchronize_rcu();
>>  		put_pid(oldpid);
>>  	}
>>  	cpu = get_cpu();
>>
> 
> Ping.
> That variant should be enough for us for future QEMUs. David has prepared some patches in QEMU that makes the other problems go away (mostly) which are currently under internal review/test.
> Let me know if you want to have the put_pid inside the if as well (or feel free to fix up yourself code  and patch description).
> 
> Thanks

Just updated kvm/next. Sorry for the noise.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux