public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Marcelo Tosatti <marcelo@kvack.org>
Cc: kvm-devel@lists.sourceforge.net
Subject: Re: [patch 3/5] KVM: hypercall batching (v2)
Date: Thu, 21 Feb 2008 20:30:04 +0200	[thread overview]
Message-ID: <47BDC32C.4040402@qumranet.com> (raw)
In-Reply-To: <20080221180512.GA30703@dmt>

Marcelo Tosatti wrote:
> On Thu, Feb 21, 2008 at 05:52:25PM +0200, Avi Kivity wrote:
>   
>> Marcelo Tosatti wrote:
>>     
>>> Batch pte updates and tlb flushes in lazy MMU mode.
>>>
>>> v1->v2:
>>> - report individual hypercall error code, have multicall return number of 
>>> processed entries.
>>> - cover entire multicall duration with slots_lock instead of 
>>> acquiring/reacquiring.
>>>  
>>>       
>> But not all hypercalls want slots_lock.
>>     
>
> But slots_lock is required for kvm_read_guest() (and write_guest()). So
> even if the underlying hypercall handling does not require slots_lock,
> it still makes sense.
>
>   

Right.  I guess it is cheap enough so we can keep this.

>> I suggested earlier switching to a "multiple mmu operation" hypercall 
>> (and not have individual mmu hypercalls). What do think about that?
>>     
>
> We need to support different MMU operations in the same multicall, for
> example normal pte writes, masked pte updates and tlb flushes. So an
> array of
>
> "operation, parameters"
>
> is required.
>
>   
>> I think hypercalls will be quite diverse in the future and batching them 
>> will not make sense always.
>>     
>
> I agree. While the infrastructure is generic allowing batching of any
> kind of hypercall, we explicitly select which ones can be batched (in
> the guest):
>
> static int can_defer_hypercall(struct kvm_para_state *state, unsigned int nr)
> {
>         if (state->mode == PARAVIRT_LAZY_MMU) {
>                 switch (nr) {
>                 case KVM_HYPERCALL_MMU_WRITE:
>                 case KVM_HYPERCALL_FLUSH_TLB:
>                         return 1;
>                 }
>         }
>         return 0;
> }
>
> Perhaps you want to move that enforcement to the host.
>
> This allows batching of future hypercalls (if appropriate) to be easy.
>
>   

I'm still uneasy about it, though I have no rational reasons left now.

Oh, there is one: with a MMU_OP hypercall you can take the mmu spinlock 
once per batch (dropping it once in a while to let another vcpu make 
progress or to inject an interrupt).

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  reply	other threads:[~2008-02-21 18:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20 19:47 [patch 0/5] KVM paravirt MMU updates and cr3 caching (v2) Marcelo Tosatti
2008-02-20 19:47 ` [patch 1/5] KVM: add basic paravirt support (v2) Marcelo Tosatti
2008-02-21 15:38   ` Avi Kivity
2008-02-21 15:55     ` Marcelo Tosatti
2008-02-21 18:31       ` Avi Kivity
2008-02-20 19:47 ` [patch 2/5] KVM: hypercall based pte updates and TLB flushes (v2) Marcelo Tosatti
2008-02-21 15:43   ` Avi Kivity
2008-02-20 19:47 ` [patch 3/5] KVM: hypercall batching (v2) Marcelo Tosatti
2008-02-21 15:52   ` Avi Kivity
2008-02-21 18:05     ` Marcelo Tosatti
2008-02-21 18:30       ` Avi Kivity [this message]
2008-02-21 19:31         ` Marcelo Tosatti
2008-02-22  7:10           ` Avi Kivity
2008-02-20 19:47 ` [patch 4/5] KVM: ignore zapped root pagetables (v2) Marcelo Tosatti
2008-02-21 15:57   ` Avi Kivity
2008-02-20 19:47 ` [patch 5/5] KVM: VMX cr3 cache support (v2) Marcelo Tosatti

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=47BDC32C.4040402@qumranet.com \
    --to=avi@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=marcelo@kvack.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