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 18:28:51 -0300 Message-ID: <20150325212851.GB3649@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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Andy Lutomirski , kvm-devel , stable , Paolo Bonzini To: Radim =?utf-8?B?S3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:58145 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751018AbbCYV3G (ORCPT ); Wed, 25 Mar 2015 17:29:06 -0400 Content-Disposition: inline In-Reply-To: <20150325125212.GC21710@potion.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Mar 25, 2015 at 01:52:15PM +0100, Radim Kr=C4=8Dm=C3=A1=C5=99 w= rote: > 2015-03-25 12:08+0100, Radim Kr=C4=8Dm=C3=A1=C5=99: > > Reverting the patch protects us from any migration, but I don't thi= nk we > > need to care about changing VCPUs as long as we read a consistent d= ata > > from kvmclock. (VCPU can change outside of this loop too, so it do= esn't > > matter if we return a value not fit for this VCPU.) > >=20 > > I think we could drop the second __getcpu if our kvmclock was being > > handled better; maybe with a patch like the one below: >=20 > The second __getcpu is not neccessary, but I forgot about rdtsc. > We need to either use rtdscp, know the host has synchronized tsc, 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 synchronized tsc t= o unsynchronized tsc (see the clocksource notifier in the host side).