From: Anthony Liguori <anthony-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
To: "Dong, Eddie" <eddie.dong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel <kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Re: [PATCH] Add need_resched check before go to kvm_resched
Date: Wed, 25 Apr 2007 18:50:42 -0500 [thread overview]
Message-ID: <462FE952.5050907@codemonkey.ws> (raw)
In-Reply-To: <10EA09EFD8728347A513008B6B0DA77A01599F54-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
Dong, Eddie wrote:
> Anthony Liguori wrote:
>
>> This should get moved to kvm_resched() since both VT/SVM would benefit
>> from this.
>>
>>
> I would suggest we just add similar code in SVM side. After we
> optimize the MSR/VMCS register save/restore to skip for
> those lightweight VM EXIT (handled by KVM). Giving up preemption
> disable in kvm_resched means we need to do a full context
> restore for host which is architecture specific.
>
The only time we'll give up preemption disable in kvm_resched is if
need_resched() is true. This is fine since it's time to lose our time
slice anyway.
I was thinking that kvm_resched should look like:
void kvm_resched(struct kvm_vcpu *vcpu)
{
if (need_resched()) {
vcpu_put(vcpu);
cond_resched();
vcpu_load(vcpu);
}
}
Which is what I assume Avi did...
> Actually I am thinking to totally give up kvm_resched and just let
> control return to Qemu which is much clean and provide Qemu
> more chance to handle some kind of hardware event such as network
> packet arrive etc. Today Qemu is totally depending on heavyweight VM
> Exit
> to handle those events and virtual IRQ injections which may be not
> sufficient.
>
Hrm, how would this work? The heavy weight MSR stuff is mostly fast
syscall related so it needs to be restored to do a sysret back to QEMU.
Plus, we'd have to drop the preempt lock which means that QEMU isn't
guaranteed to be on the same CPU anymore. We would also need scheduler
hooks to know when QEMU got descheduled to restore the remaining cpu state.
Regards,
Anthony Liguori
> Thanks, eddie
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
next prev parent reply other threads:[~2007-04-25 23:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-25 12:40 [PATCH] Add need_resched check before go to kvm_resched Dong, Eddie
[not found] ` <10EA09EFD8728347A513008B6B0DA77A01599EB3-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-04-25 12:45 ` Avi Kivity
[not found] ` <462F4D58.7090607-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-25 13:17 ` Dong, Eddie
[not found] ` <10EA09EFD8728347A513008B6B0DA77A01599ECA-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-04-25 13:49 ` Avi Kivity
2007-04-25 13:49 ` Anthony Liguori
[not found] ` <462F5C7E.7010605-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-04-25 13:53 ` Avi Kivity
2007-04-25 23:18 ` Dong, Eddie
[not found] ` <10EA09EFD8728347A513008B6B0DA77A01599F54-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-04-25 23:50 ` Anthony Liguori [this message]
[not found] ` <462FE952.5050907-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-04-26 0:23 ` Dong, Eddie
[not found] ` <10EA09EFD8728347A513008B6B0DA77A01599FA7-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-04-26 0:35 ` Anthony Liguori
[not found] ` <462FF3B7.6010707-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-04-26 1:04 ` Dong, Eddie
[not found] ` <10EA09EFD8728347A513008B6B0DA77A0159A036-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-04-26 2:15 ` Anthony Liguori
2007-04-26 4:46 ` Avi Kivity
[not found] ` <46302E8F.6070301-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-26 4:56 ` Anthony Liguori
2007-04-26 4:41 ` 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=462FE952.5050907@codemonkey.ws \
--to=anthony-rdkfgonbjusknkdkm+me6a@public.gmane.org \
--cc=eddie.dong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/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