All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>, kvm@vger.kernel.org
Subject: Re: [PATCH RFC] KVM: MMU: Don't use RCU for lockless shadow walking
Date: Mon, 14 May 2012 15:41:18 +0300	[thread overview]
Message-ID: <4FB0FD6E.5020705@redhat.com> (raw)
In-Reply-To: <4F96713A.9050706@redhat.com>

On 04/24/2012 12:24 PM, Avi Kivity wrote:
> On 04/24/2012 04:17 AM, Marcelo Tosatti wrote:
> > On Mon, Apr 23, 2012 at 07:16:52PM +0300, Avi Kivity wrote:
> > > Using RCU for lockless shadow walking can increase the amount of memory
> > > in use by the system, since RCU grace periods are unpredictable.  We also
> > > have an unconditional write to a shared variable (reader_counter), which
> > > isn't good for scaling.
> > > 
> > > Replace that with a scheme similar to x86's get_user_pages_fast(): disable
> > > interrupts during lockless shadow walk to force the freer
> > > (kvm_mmu_commit_zap_page()) to wait for the TLB flush IPI to find the
> > > processor with interrupts enabled.
> > > 
> > > We also add a new vcpu->mode, READING_SHADOW_PAGE_TABLES, to prevent
> > > kvm_flush_remote_tlbs() from avoiding the IPI.
> > > 
> >
> > Should add an explicit mb after prepare_zap_page? (currently rely on
> > unrelated ones internal to flush_remote_tlbs).
>
> Yes.

Is that really true?  If unlocked shadow walk doesn't see the changes by
prepare_zap_page(), it will still see valid sptes that will not be
reused (blocked by kvm_flush_remote_tlbs()).  If it does see the
changes, it won't access those sptes at all. Either way we're fine.

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


  reply	other threads:[~2012-05-14 12:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 16:16 [PATCH RFC] KVM: MMU: Don't use RCU for lockless shadow walking Avi Kivity
2012-04-24  1:17 ` Marcelo Tosatti
2012-04-24  9:24   ` Avi Kivity
2012-05-14 12:41     ` Avi Kivity [this message]
2012-04-24  6:37 ` Xiao Guangrong
2012-04-24  9:19   ` Avi Kivity
2012-04-24  9:23     ` Avi Kivity
2012-04-24  9:54     ` Xiao Guangrong
2012-04-24 10:02       ` Avi Kivity
2012-04-24 10:05         ` Xiao Guangrong

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=4FB0FD6E.5020705@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=xiaoguangrong@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.