public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Kaushik Barde <kbarde@huawei.com>
Cc: "'Avi Kivity'" <avi@redhat.com>,
	"'Jan Beulich'" <JBeulich@novell.com>,
	"'Xiaowei Yang'" <xiaowei.yang@huawei.com>,
	"'Nick Piggin'" <npiggin@kernel.dk>,
	"'Peter Zijlstra'" <a.p.zijlstra@chello.nl>,
	fanhenglong@huawei.com, "'Kenneth Lee'" <liguozhu@huawei.com>,
	"'linqaingmin'" <linqiangmin@huawei.com>,
	wangzhenguo@huawei.com, "'Wu Fengguang'" <fengguang.wu@intel.com>,
	xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org,
	"'Marcelo Tosatti'" <mtosatti@redhat.com>
Subject: Re: One (possible) x86 get_user_pages bug
Date: Mon, 31 Jan 2011 14:10:11 -0800	[thread overview]
Message-ID: <4D473343.7080708@goop.org> (raw)
In-Reply-To: <003301cbc182$da3affc0$8eb0ff40$@com>

On 01/31/2011 12:10 PM, Kaushik Barde wrote:
> << I'm not sure I follow you here.  The issue with TLB flush IPIs is that
> the hypervisor doesn't know the purpose of the IPI and ends up
> (potentially) waking up a sleeping VCPU just to flush its tlb - but
> since it was sleeping there were no stale TLB entries to flush.>>
>
> That's what I was trying understand, what is "Sleep" here? Is it ACPI sleep
> or some internal scheduling state? If vCPUs  are asynchronous to pCPU in
> terms of ACPI sleep state, then they need to synced-up. That's where entire
> ACPI modeling needs to be considered. That's where KVM may not see this
> issue. Maybe I am missing something here.

No, nothing to do with ACPI.  Multiple virtual CPUs (VCPUs) can be
multiplexed onto a single physical CPU (PCPU), in much the same way as
tasks are scheduled onto CPUs (identically, in KVM's case).  If a VCPU
is not currently running - either because it is simply descheduled, or
because it is blocked (what I slightly misleadingly called "sleeping"
above) in a hypercall, then it is not currently using any physical CPU
resources, including the TLBs.  In that case, there's no need to flush
that's VCPU's TLB entries, because there are none.

> << A "few hundred uSecs" is really very slow - that's nearly a
> millisecond.  It's worth spending some effort to avoid those kinds of
> delays.>>
>
> Actually, just checked IPIs are usually 1000-1500 cycles long (comparable to
> VMEXIT). My point is ideal solution should be where virtual platform
> behavior is closer to bare metal interrupts, memory, cpu state etc.. How to
> do it ? well that's what needs to be figured out :-)

The interesting number is not the raw cost of an IPI, but the overall
cost of the remote TLB flush.

    J

  reply	other threads:[~2011-01-31 22:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-27 13:05 One (possible) x86 get_user_pages bug Xiaowei Yang
2011-01-27 13:56 ` Peter Zijlstra
2011-01-27 14:30   ` Jan Beulich
2011-01-28 10:51     ` Peter Zijlstra
2011-01-27 14:49 ` Jan Beulich
2011-01-27 15:01   ` Peter Zijlstra
2011-01-27 18:27   ` Jeremy Fitzhardinge
2011-01-27 19:27     ` Peter Zijlstra
2011-01-30 13:01     ` Avi Kivity
2011-01-30 22:21       ` Kaushik Barde
2011-01-31 18:04         ` Jeremy Fitzhardinge
2011-01-31 20:10           ` Kaushik Barde
2011-01-31 22:10             ` Jeremy Fitzhardinge [this message]
2011-01-27 16:07 ` Jan Beulich
2011-01-27 16:25   ` Peter Zijlstra
2011-01-27 16:41     ` Jan Beulich
2011-01-27 16:56   ` Peter Zijlstra
2011-01-27 21:24   ` Nick Piggin
2011-01-28  7:17     ` Xiaowei Yang

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=4D473343.7080708@goop.org \
    --to=jeremy@goop.org \
    --cc=JBeulich@novell.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=avi@redhat.com \
    --cc=fanhenglong@huawei.com \
    --cc=fengguang.wu@intel.com \
    --cc=kbarde@huawei.com \
    --cc=liguozhu@huawei.com \
    --cc=linqiangmin@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=npiggin@kernel.dk \
    --cc=wangzhenguo@huawei.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xiaowei.yang@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