From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751533AbdCAOSy (ORCPT ); Wed, 1 Mar 2017 09:18:54 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:48829 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750968AbdCAOSv (ORCPT ); Wed, 1 Mar 2017 09:18:51 -0500 Date: Wed, 1 Mar 2017 15:17:16 +0100 From: Peter Zijlstra To: Wanpeng Li Cc: Paolo Bonzini , Mike Galbraith , LKML , Ingo Molnar , Thomas Gleixner , Borislav Petkov Subject: Re: tip.today - scheduler bam boom crash (cpu hotplug) Message-ID: <20170301141716.GH6515@twins.programming.kicks-ass.net> References: <20170227124349.GU6515@twins.programming.kicks-ass.net> <3e7c34e2-757b-19e9-f7e5-9bfaadd79e5d@redhat.com> <20170227130440.GW6500@twins.programming.kicks-ass.net> <15367170-e1c0-8901-7e15-940d8d699c21@redhat.com> <20170227155954.GY6500@twins.programming.kicks-ass.net> <111f89b9-22e3-5a0f-3469-6f64092521ff@redhat.com> <20170228080855.GV6515@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 01, 2017 at 09:39:18PM +0800, Wanpeng Li wrote: > 2017-02-28 16:11 GMT+08:00 Wanpeng Li : > > 2017-02-28 16:08 GMT+08:00 Peter Zijlstra : > >> On Tue, Feb 28, 2017 at 09:51:07AM +0800, Wanpeng Li wrote: > >>> diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c > >>> index 4e95b2e..ed8eda4 100644 > >>> --- a/arch/x86/kernel/cpu/amd.c > >>> +++ b/arch/x86/kernel/cpu/amd.c > >>> @@ -557,7 +557,7 @@ static void early_init_amd(struct cpuinfo_x86 *c) > >>> set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC); > >>> if (check_tsc_unstable()) > >>> clear_sched_clock_stable(); > >>> - } else { > >>> + } else if (!boot_cpu_has(X86_FEATURE_HYPERVISOR)) { > >>> clear_sched_clock_stable(); > >>> } > >> > >> That's wrong, you can have HYPERVISOR and still use > >> native_sched_clock() (lguest does that for one). > > > > My posting delay to check this in tsc_init(). > > Does it make sense? It makes confusion from where I'm sitting. Please look at that latest patch I send. I think it should work, but in case you have doubts, try and find the holes. http://lkml.kernel.org/r/20170228080855.GV6515@twins.programming.kicks-ass.net That marries the sched_clock stable to the existing TSC stable machinery and removes a bunch of quirks.