From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755713AbdJLLSB (ORCPT ); Thu, 12 Oct 2017 07:18:01 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:37253 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753189AbdJLLSA (ORCPT ); Thu, 12 Oct 2017 07:18:00 -0400 Date: Thu, 12 Oct 2017 13:17:12 +0200 (CEST) From: Thomas Gleixner To: mike.travis@hpe.com cc: Peter Zijlstra , Ingo Molnar , "H. Peter Anvin" , Bin Gao , Prarit Bhargava , Dimitri Sivanich , Andrew Banman , Russ Anderson , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 2/5] x86/kernel: Skip TSC test and error messages if already unstable In-Reply-To: <20171005164716.507003714@stormcage.americas.sgi.com> Message-ID: References: <20171005164716.233817374@stormcage.americas.sgi.com> <20171005164716.507003714@stormcage.americas.sgi.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 5 Oct 2017, mike.travis@hpe.com wrote: > If the TSC has already been determined to be unstable, then checking > TSC ADJUST values is a waste of time and generates unnecessary error > messages. > > Signed-off-by: Mike Travis > Reviewed-by: Dimitri Sivanich > Reviewed-by: Russ Anderson > Reviewed-by: Peter Zijlstra > --- > arch/x86/kernel/tsc_sync.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > --- linux.orig/arch/x86/kernel/tsc_sync.c > +++ linux/arch/x86/kernel/tsc_sync.c > @@ -38,6 +38,10 @@ void tsc_verify_tsc_adjust(bool resume) > if (!boot_cpu_has(X86_FEATURE_TSC_ADJUST)) > return; > > + /* Skip unnecessary error messages if TSC already unstable */ > + if (check_tsc_unstable()) > + return; > + > /* Rate limit the MSR check */ > if (!resume && time_before(jiffies, adj->nextcheck)) > return; > @@ -89,6 +93,10 @@ bool tsc_store_and_check_tsc_adjust(bool > if (!boot_cpu_has(X86_FEATURE_TSC_ADJUST)) > return false; > > + /* Skip unnecessary error messages if TSC already unstable */ > + if (check_tsc_unstable()) > + return false; > + > rdmsrl(MSR_IA32_TSC_ADJUST, bootval); > cur->bootval = bootval; > cur->adjusted = bootval; This hunk rejects and I really can't figure out against which tree that would apply. Btw, there are two incarnations of tsc_store_and_check_tsc_adjust(). Shouldn't the !SMP variant get the same treatment? Thanks, tglx