[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170811090336.lfznz6qzrbhiqwvi@hirez.programming.kicks-ass.net>
Date: Fri, 11 Aug 2017 11:03:36 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Jork Loeser <Jork.Loeser@...rosoft.com>
Cc: KY Srinivasan <kys@...rosoft.com>,
Simon Xiao <sixiao@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>,
"luto@...nel.org" <luto@...nel.org>,
"hpa@...or.com" <hpa@...or.com>,
"vkuznets@...hat.com" <vkuznets@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"rostedt@...dmis.org" <rostedt@...dmis.org>,
"andy.shevchenko@...il.com" <andy.shevchenko@...il.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...nel.org" <mingo@...nel.org>,
"linux-tip-commits@...r.kernel.org"
<linux-tip-commits@...r.kernel.org>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Subject: Re: [tip:x86/platform] x86/hyper-v: Use hypercall for remote TLB
flush
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?
Powered by blists - more mailing lists