From: Rik van Riel <riel@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Mike Galbraith <efault@gmx.de>,
Chris Wright <chrisw@sous-sol.org>
Subject: Re: [RFC -v4 PATCH 3/3] kvm: use yield_to instead of sleep in kvm_vcpu_on_spin
Date: Thu, 13 Jan 2011 10:06:56 -0500 [thread overview]
Message-ID: <4D2F1510.3000809@redhat.com> (raw)
In-Reply-To: <4D2EFB44.2060906@redhat.com>
On 01/13/2011 08:16 AM, Avi Kivity wrote:
>> + for (pass = 0; pass< 2&& !yielded; pass++) {
>> + kvm_for_each_vcpu(i, vcpu, kvm) {
>> + struct task_struct *task = vcpu->task;
>> + if (!pass&& i< last_boosted_vcpu) {
>> + i = last_boosted_vcpu;
>> + continue;
>> + } else if (pass&& i> last_boosted_vcpu)
>> + break;
>> + if (vcpu == me)
>> + continue;
>> + if (!task)
>> + continue;
>> + if (waitqueue_active(&vcpu->wq))
>> + continue;
>
> Suppose the vcpu exits at this point, and its task terminates.
Arghh, good point.
> I think the first patch needs some reference counting... I'd move it to
> the outermost KVM_RUN loop to reduce the performance impact.
I don't see how refcounting from that other thread could
possibly help, and I now see that the task_struct_cachep
does not have SLAB_DESTROY_BY_LRU, either :(
What do you have in mind here that would both work and
be acceptable to you as KVM maintainer?
--
All rights reversed
next prev parent reply other threads:[~2011-01-13 15:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-13 5:21 [RFC -v4 PATCH 0/3] directed yield for Pause Loop Exiting Rik van Riel
2011-01-13 5:22 ` [RFC -v4 PATCH 1/3] kvm: keep track of which task is running a KVM vcpu Rik van Riel
2011-01-13 5:26 ` [RFC -v4 PATCH 2/3] sched: Add yield_to(task, preempt) functionality Rik van Riel
2011-01-13 5:27 ` [RFC -v4 PATCH 3/3] kvm: use yield_to instead of sleep in kvm_vcpu_on_spin Rik van Riel
2011-01-13 13:16 ` Avi Kivity
2011-01-13 15:06 ` Rik van Riel [this message]
2011-01-13 15:23 ` Avi Kivity
2011-01-14 0:10 ` Rik van Riel
2011-01-13 13:12 ` [RFC -v4 PATCH 0/3] directed yield for Pause Loop Exiting Avi Kivity
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=4D2F1510.3000809@redhat.com \
--to=riel@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=avi@redhat.com \
--cc=chrisw@sous-sol.org \
--cc=efault@gmx.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vatsa@linux.vnet.ibm.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