linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Jork Loeser <Jork.Loeser@microsoft.com>
Cc: KY Srinivasan <kys@microsoft.com>,
	Simon Xiao <sixiao@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"luto@kernel.org" <luto@kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"vkuznets@redhat.com" <vkuznets@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"andy.shevchenko@gmail.com" <andy.shevchenko@gmail.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@kernel.org" <mingo@kernel.org>,
	"linux-tip-commits@vger.kernel.org" 
	<linux-tip-commits@vger.kernel.org>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: Re: [tip:x86/platform] x86/hyper-v: Use hypercall for remote TLB flush
Date: Fri, 11 Aug 2017 11:03:36 +0200	[thread overview]
Message-ID: <20170811090336.lfznz6qzrbhiqwvi@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CY4PR21MB0631989FA0C9135AAD2DD1F8F1890@CY4PR21MB0631.namprd21.prod.outlook.com>

On Fri, Aug 11, 2017 at 01:15:18AM +0000, Jork Loeser wrote:

> > > HvFlushVirtualAddressList() states:
> > > This call guarantees that by the time control returns back to the
> > > caller, the observable effects of all flushes on the specified virtual
> > > processors have occurred.
> > >
> > > HvFlushVirtualAddressListEx() refers to HvFlushVirtualAddressList() as adding
> > > sparse target VP lists.
> > >
> > > Is this enough of a guarantee, or do you see other races?
> > 
> > That's nowhere near enough. We need the remote CPU to have completed any
> > guest IF section that was in progress at the time of the call.
> > 
> > So if a host IPI can interrupt a guest while the guest has IF cleared, and we then
> > process the host IPI -- clear the TLBs -- before resuming the guest, which still has
> > IF cleared, we've got a problem.
> > 
> > Because at that point, our software page-table walker, that relies on IF being
> > clear to guarantee the page-tables exist, because it holds off the TLB invalidate
> > and thereby the freeing of the pages, gets its pages ripped out from under it.
> 
> I see, IF is used as a locking mechanism for the pages. Would
> CONFIG_HAVE_RCU_TABLE_FREE be an option for x86? There are caveats
> (statically enabled, RCU for page-free), yet if the resulting perf is
> still a gain it would be worthwhile for Hyper-V targeted kernels.

I'm sure we talked about using HAVE_RCU_TABLE_FREE for x86 (and yes that
would make it work again), but this was some years ago and I cannot
readily find those emails.

Kirill would you have any opinions?

  reply	other threads:[~2017-08-11  9:03 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02 16:09 [PATCH v10 0/9] Hyper-V: paravirtualized remote TLB flushing and hypercall improvements Vitaly Kuznetsov
2017-08-02 16:09 ` [PATCH v10 1/9] x86/hyper-v: include hyperv/ only when CONFIG_HYPERV is set Vitaly Kuznetsov
2017-08-10 16:37   ` [tip:x86/platform] x86/hyper-v: Include " tip-bot for Vitaly Kuznetsov
2017-08-02 16:09 ` [PATCH v10 2/9] x86/hyper-v: make hv_do_hypercall() inline Vitaly Kuznetsov
2017-08-10 16:37   ` [tip:x86/platform] x86/hyper-v: Make " tip-bot for Vitaly Kuznetsov
2017-08-02 16:09 ` [PATCH v10 3/9] x86/hyper-v: fast hypercall implementation Vitaly Kuznetsov
2017-08-10 16:37   ` [tip:x86/platform] x86/hyper-v: Introduce " tip-bot for Vitaly Kuznetsov
2017-08-02 16:09 ` [PATCH v10 4/9] hyper-v: use fast hypercall for HVCALL_SIGNAL_EVENT Vitaly Kuznetsov
2017-08-10 16:38   ` [tip:x86/platform] hyper-v: Use " tip-bot for Vitaly Kuznetsov
2017-08-02 16:09 ` [PATCH v10 5/9] x86/hyper-v: implement rep hypercalls Vitaly Kuznetsov
2017-08-10 16:38   ` [tip:x86/platform] x86/hyper-v: Implement " tip-bot for Vitaly Kuznetsov
2017-08-02 16:09 ` [PATCH v10 6/9] hyper-v: globalize vp_index Vitaly Kuznetsov
2017-08-10 16:39   ` [tip:x86/platform] hyper-v: Globalize vp_index tip-bot for Vitaly Kuznetsov
2017-08-02 16:09 ` [PATCH v10 7/9] x86/hyper-v: use hypercall for remote TLB flush Vitaly Kuznetsov
2017-08-10 16:39   ` [tip:x86/platform] x86/hyper-v: Use " tip-bot for Vitaly Kuznetsov
2017-08-10 18:21   ` tip-bot for Vitaly Kuznetsov
2017-08-10 18:56     ` Peter Zijlstra
2017-08-10 18:59       ` KY Srinivasan
2017-08-10 19:08         ` Jork Loeser
2017-08-10 19:27           ` Peter Zijlstra
2017-08-11  1:15             ` Jork Loeser
2017-08-11  9:03               ` Peter Zijlstra [this message]
2017-08-11 11:29                 ` Kirill A. Shutemov
2017-08-11 16:16                 ` Linus Torvalds
2017-08-11 16:26                   ` Peter Zijlstra
2017-08-14 13:20                     ` Vitaly Kuznetsov
2017-08-16 16:42                       ` Vitaly Kuznetsov
2017-08-16 21:41                         ` Boris Ostrovsky
2017-08-17  7:58                           ` Vitaly Kuznetsov
2017-08-11  9:23             ` Vitaly Kuznetsov
2017-08-11 10:56               ` Peter Zijlstra
2017-08-11 11:05                 ` [Xen-devel] " Andrew Cooper
2017-08-11 12:07                   ` Peter Zijlstra
2017-08-16  0:02                     ` Steven Rostedt
2017-08-11 12:22                 ` Juergen Gross
2017-08-11 12:35                   ` Peter Zijlstra
2017-08-11 12:46                     ` Juergen Gross
2017-08-11 12:54                       ` Peter Zijlstra
2017-08-11 13:07                         ` Juergen Gross
2017-08-11 13:39                           ` Peter Zijlstra
2017-08-02 16:09 ` [PATCH v10 8/9] x86/hyper-v: support extended CPU ranges for TLB flush hypercalls Vitaly Kuznetsov
2017-08-31 20:01   ` [tip:x86/platform] x86/hyper-v: Support " tip-bot for Vitaly Kuznetsov
2017-08-02 16:09 ` [PATCH v10 9/9] tracing/hyper-v: trace hyperv_mmu_flush_tlb_others() Vitaly Kuznetsov
2017-08-31 20:01   ` [tip:x86/platform] tracing/hyper-v: Trace hyperv_mmu_flush_tlb_others() tip-bot for Vitaly Kuznetsov
2017-08-10 11:58 ` [PATCH v10 0/9] Hyper-V: paravirtualized remote TLB flushing and hypercall improvements Vitaly Kuznetsov
2017-08-10 15:12   ` Ingo Molnar
2017-08-10 15:17     ` Vitaly Kuznetsov
2017-08-10 16:03 ` Ingo Molnar
2017-08-10 17:00   ` Vitaly Kuznetsov
2017-08-31 11:43 ` Vitaly Kuznetsov
2017-08-31 12:22   ` Ingo Molnar
2017-08-31 14:53     ` Vitaly Kuznetsov
2017-08-31 20:01       ` Ingo Molnar
2017-11-06  8:43 ` Wanpeng Li
2017-11-06  9:14   ` Vitaly Kuznetsov
2017-11-06  9:57     ` Wanpeng Li
2017-11-06 10:10       ` Vitaly Kuznetsov
2017-11-06 11:07         ` Wanpeng Li

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=20170811090336.lfznz6qzrbhiqwvi@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Jork.Loeser@microsoft.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=haiyangz@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sixiao@microsoft.com \
    --cc=sthemmin@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vkuznets@redhat.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;
as well as URLs for NNTP newsgroup(s).