From: David Hildenbrand <david@redhat.com>
To: "Longpeng(Mike)" <longpeng2@huawei.com>,
pbonzini@redhat.com, rkrcmar@redhat.com
Cc: agraf@suse.com, borntraeger@de.ibm.com, cohuck@redhat.com,
christoffer.dall@linaro.org, marc.zyngier@arm.com,
james.hogan@imgtec.com, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, weidong.huang@huawei.com,
arei.gonglei@huawei.com, wangxinxin.wang@huawei.com,
longpeng.mike@gmail.com
Subject: Re: [PATCH v2 1/4] KVM: add spinlock optimization framework
Date: Tue, 8 Aug 2017 10:44:43 +0200 [thread overview]
Message-ID: <8c0c74eb-da08-aee1-0037-d8b9c9021b41@redhat.com> (raw)
In-Reply-To: <8f4e336d-82b2-9148-eac3-ad411e6a16ef@redhat.com>
On 08.08.2017 10:42, David Hildenbrand wrote:
>
>> +bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu)
>> +{
>> + return false;
>> +}
>
> why don't we need an EXPORT_SYMBOL here?
>
>> +
>> /* Just ensure a guest exit from a particular CPU */
>> static void exit_vm_noop(void *info)
>> {
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 15252d7..e7720d2 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -2317,7 +2317,7 @@ static bool kvm_vcpu_eligible_for_directed_yield(struct kvm_vcpu *vcpu)
>> #endif
>> }
>>
>> -void kvm_vcpu_on_spin(struct kvm_vcpu *me)
>> +void kvm_vcpu_on_spin(struct kvm_vcpu *me, bool me_in_kern)
>> {
>> struct kvm *kvm = me->kvm;
>> struct kvm_vcpu *vcpu;
>> @@ -2348,6 +2348,8 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me)
>> continue;
>> if (swait_active(&vcpu->wq) && !kvm_arch_vcpu_runnable(vcpu))
>> continue;
>> + if (me_in_kern && !kvm_arch_vcpu_in_kernel(vcpu))
>> + continue;
>
>
> hm, does this patch compile? (me_in_kern)
pardon me, missed the parameter, so ignore this comment. comment
regarding splitting up below still holds :)
>
> I would even move this to an other patch.
>
> Maybe even split into
>
> a) introducing kvm_arch_vcpu_in_kernel() for all archs
> b) modifying kvm_vcpu_on_spin(), passing the result from
> kvm_arch_vcpu_in_kernel()
> c) filling kvm_arch_vcpu_in_kernel() with life for different archs
> (multiple patches)
> d) pimping kvm_vcpu_on_spin()
>
>> if (!kvm_vcpu_eligible_for_directed_yield(vcpu))
>> continue;
>>
>>
>
>
--
Thanks,
David
next prev parent reply other threads:[~2017-08-08 8:44 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 4:05 [PATCH v2 0/4] KVM: optimize the kvm_vcpu_on_spin Longpeng(Mike)
2017-08-08 4:05 ` [PATCH v2 1/4] KVM: add spinlock optimization framework Longpeng(Mike)
2017-08-08 7:34 ` Paolo Bonzini
2017-08-08 7:43 ` Cornelia Huck
2017-08-08 8:42 ` David Hildenbrand
2017-08-08 8:44 ` David Hildenbrand [this message]
2017-08-08 9:00 ` Paolo Bonzini
2017-08-08 9:35 ` Longpeng (Mike)
2017-08-08 4:05 ` [PATCH v2 2/4] KVM: X86: implement the logic for spinlock optimization Longpeng(Mike)
2017-08-08 7:30 ` Paolo Bonzini
2017-08-08 8:31 ` Longpeng (Mike)
2017-08-08 8:39 ` Paolo Bonzini
2017-08-08 4:05 ` [PATCH v2 3/4] KVM: s390: implements the kvm_arch_vcpu_in_kernel() Longpeng(Mike)
2017-08-08 7:37 ` Cornelia Huck
2017-08-08 8:35 ` David Hildenbrand
2017-08-08 4:05 ` [PATCH v2 4/4] KVM: arm: " Longpeng(Mike)
2017-08-08 7:39 ` Christoffer Dall
2017-08-08 7:41 ` Christoffer Dall
2017-08-08 7:41 ` [PATCH v2 0/4] KVM: optimize the kvm_vcpu_on_spin Cornelia Huck
2017-08-08 8:14 ` Longpeng (Mike)
2017-08-10 13:18 ` Eric Farman
2017-08-11 1:43 ` Longpeng (Mike)
2017-08-11 7:19 ` Cornelia Huck
2017-08-08 11:25 ` David Hildenbrand
2017-08-08 11:30 ` Christoffer Dall
2017-08-08 11:49 ` Longpeng (Mike)
2017-08-08 11:50 ` David Hildenbrand
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=8c0c74eb-da08-aee1-0037-d8b9c9021b41@redhat.com \
--to=david@redhat.com \
--cc=agraf@suse.com \
--cc=arei.gonglei@huawei.com \
--cc=borntraeger@de.ibm.com \
--cc=christoffer.dall@linaro.org \
--cc=cohuck@redhat.com \
--cc=james.hogan@imgtec.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longpeng.mike@gmail.com \
--cc=longpeng2@huawei.com \
--cc=marc.zyngier@arm.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=wangxinxin.wang@huawei.com \
--cc=weidong.huang@huawei.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
all inboxes | Powered by JetHome®