From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: KVM <kvm@vger.kernel.org>, Gleb Natapov <gleb@kernel.org>,
raghavendra.kt@linux.vnet.ibm.com, riel@redhat.com,
dahi@linux.vnet.ibm.com
Subject: Re: [PATCH] KVM: avoid unnecessary synchronize_rcu
Date: Mon, 25 Aug 2014 10:27:09 +0200 [thread overview]
Message-ID: <53FAF35D.3080605@de.ibm.com> (raw)
In-Reply-To: <53FAF2D0.3010805@de.ibm.com>
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@de.ibm.com>
>> ---
>> 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.
prev parent reply other threads:[~2014-08-25 8:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-19 14:45 [PATCH] KVM: avoid unnecessary synchronize_rcu Christian Borntraeger
2014-08-19 15:03 ` Raghavendra K T
2014-08-25 8:24 ` Christian Borntraeger
2014-08-25 8:27 ` Christian Borntraeger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53FAF35D.3080605@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=dahi@linux.vnet.ibm.com \
--cc=gleb@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=raghavendra.kt@linux.vnet.ibm.com \
--cc=riel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox