From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: x86: kvm: Revert "remove sched notifier for cross-cpu migrations" Date: Wed, 25 Mar 2015 20:13:17 -0300 Message-ID: <20150325231317.GA7144@amt.cnet> References: <20150323232151.GA12772@amt.cnet> <20150324153412.GB21710@potion.brq.redhat.com> <20150325110814.GE21522@potion.brq.redhat.com> <20150325125212.GC21710@potion.brq.redhat.com> <20150325212851.GB3649@amt.cnet> <20150325224145.GA5928@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm list , Radim Krcmar , stable , Paolo Bonzini To: Andy Lutomirski Return-path: Content-Disposition: inline In-Reply-To: Sender: stable-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Wed, Mar 25, 2015 at 03:48:02PM -0700, Andy Lutomirski wrote: > On Wed, Mar 25, 2015 at 3:41 PM, Marcelo Tosatti wrote: > > On Wed, Mar 25, 2015 at 03:33:10PM -0700, Andy Lutomirski wrote: > >> On Mar 25, 2015 2:29 PM, "Marcelo Tosatti" w= rote: > >> > > >> > On Wed, Mar 25, 2015 at 01:52:15PM +0100, Radim Kr=C4=8Dm=C3=A1=C5= =99 wrote: > >> > > 2015-03-25 12:08+0100, Radim Kr=C4=8Dm=C3=A1=C5=99: > >> > > > Reverting the patch protects us from any migration, but I do= n't think we > >> > > > need to care about changing VCPUs as long as we read a consi= stent data > >> > > > from kvmclock. (VCPU can change outside of this loop too, s= o it doesn't > >> > > > matter if we return a value not fit for this VCPU.) > >> > > > > >> > > > I think we could drop the second __getcpu if our kvmclock wa= s being > >> > > > handled better; maybe with a patch like the one below: > >> > > > >> > > The second __getcpu is not neccessary, but I forgot about rdts= c. > >> > > We need to either use rtdscp, know the host has synchronized t= sc, or > >> > > monitor VCPU migrations. Only the last one works everywhere. > >> > > >> > The vdso code is only used if host has synchronized tsc. > >> > > >> > But you have to handle the case where host goes from synchronize= d tsc to > >> > unsynchronized tsc (see the clocksource notifier in the host sid= e). > >> > > >> > >> Can't we change the host to freeze all vcpus and clear the stable = bit > >> on all of them if this happens? This would simplify and speed up > >> vclock_gettime. > >> > >> --Andy > > > > Seems interesting to do on 512-vcpus, but sure, could be done. > > >=20 > If you have a 512-vcpu system that switches between stable and > unstable more than once per migration, then I expect that you have > serious problems and this is the least of your worries. >=20 > Personally, I'd *much* rather we just made vcpu 0's pvti authoritativ= e > if we're stable. If nothing else, I'm not even remotely convinced > that the current scheme gives monotonic timing due to skew between > when the updates happen on different vcpus. Can you write down the problem ?