[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171109173512.GH20859@flask>
Date: Thu, 9 Nov 2017 18:35:12 +0100
From: Radim Krcmar <rkrcmar@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Pankaj Gupta <pagupta@...hat.com>,
Wanpeng Li <kernellwp@...il.com>,
Eduardo Valentin <eduval@...zon.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Matt Wilson <msw@...zon.com>, Jonathan Corbet <corbet@....net>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
the arch/x86 maintainers <x86@...nel.org>,
Waiman Long <longman@...hat.com>, kvm <kvm@...r.kernel.org>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
"Jan H . Schoenherr" <jschoenh@...zon.de>,
Anthony Liguori <aliguori@...zon.com>
Subject: Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when
PV_DEDICATED is set
2017-11-09 18:28+0100, Peter Zijlstra:
> On Thu, Nov 09, 2017 at 06:15:11PM +0100, Peter Zijlstra wrote:
> > On Thu, Nov 09, 2017 at 06:12:41PM +0100, Peter Zijlstra wrote:
> > > On Thu, Nov 09, 2017 at 05:45:23PM +0100, Radim Krcmar wrote:
> > > > 2017-11-09 17:17+0100, Peter Zijlstra:
> > > > > On Thu, Nov 09, 2017 at 05:05:36PM +0100, Radim Krcmar wrote:
> > > > > > 2017-11-09 10:53-0500, Pankaj Gupta:
> > > > > > > 2] PV TLB should also behave as per option PV_DEDICATED for better performance.
> > > > > >
> > > > > > Right,
> > > > >
> > > > > Shouldn't KVM do flush_tlb_other() in any case? Not sure how
> > > > > PV_DEDICATED can help with that.
> > > >
> > > > It will, the suggestion was based on recent extension of the
> > > > flush_tlb_others implementaion, https://lkml.org/lkml/2017/11/8/1146.
> > > >
> > > > PV_TLB_FLUSH allows a guest to set a flush bit instead of sending flush
> > > > IPI if the target VCPU is not running. This would be a waste of time
> > > > with PV_DEDICATED as all VCPUs are expected to always running.
> > > >
> > > > With PV_DEDICATED, the guest should keep using native_flush_tlb_others.
> > >
> > > Is saving that for_each_cpu() really worth the effort compared to the
> > > cost of actually doing the IPIs and CR3 write?
> > >
> > > Also, you should not put cpumask_t on stack, that's 'broken'.
> >
> > Also, you'll want to use __cpumask_clear_cpu() there.
>
> Also^2, that patch split is crazy, after patch 2/3 your machine is
> broken due to lost TLB flushes. You have to first add the SHOULD_FLUSH
> handling and then clear CPUs from the native_flush_tlb_other() mask.
That should be fixed in v2 -- [2/3] must not enable this feature if the
host has not exposed it and [3/3] has to expose it. (The ordering of
those two doesn't matter as they are separate kernel.)
Powered by blists - more mailing lists