Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752068AbdFTNOi (ORCPT ); Tue, 20 Jun 2017 09:14:38 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:43726 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbdFTNOh (ORCPT ); Tue, 20 Jun 2017 09:14:37 -0400 Date: Tue, 20 Jun 2017 15:14:26 +0200 (CEST) From: Thomas Gleixner To: Zhenzhong Duan cc: mingo@redhat.com, hpa@zytor.com, x86@kernel.org, LKML Subject: Re: [PATCH] Calling check_system_tsc_reliable before unsynchronized_tsc In-Reply-To: <3fbce128-1468-45f1-2f54-974132553177@oracle.com> Message-ID: References: <3fbce128-1468-45f1-2f54-974132553177@oracle.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1206976284-1497964466=:1869" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2042 Lines: 63 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1206976284-1497964466=:1869 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 8BIT On Tue, 13 Jun 2017, Zhenzhong Duan wrote: > ?? 2017/6/13 0:03, Thomas Gleixner ะด??: > > On Thu, 8 Jun 2017, Zhenzhong Duan wrote: > > > > > unsynchronized_tsc() checks value of tsc_clocksource_reliable which is set > > > by > > > check_system_tsc_reliable(). It's better to move > > > check_system_tsc_reliable() > > > at > > > front, or else this check makes no sense. > > > > > > Though X86_FEATURE_CONSTANT_TSC is usually set for TSC reliable system, > > > just > > > in > > > case. > > > > > > Signed-off-by: Zhenzhong Duan > > > --- > > > arch/x86/kernel/tsc.c | 4 ++-- > > > 1 files changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c > > > index 714dfba..a316bdd 100644 > > > --- a/arch/x86/kernel/tsc.c > > > +++ b/arch/x86/kernel/tsc.c > > > @@ -1412,11 +1412,11 @@ void __init tsc_init(void) > > > use_tsc_delay(); > > > + check_system_tsc_reliable(); > > > + > > > if (unsynchronized_tsc()) > > > mark_tsc_unstable("TSCs unsynchronized"); > > > - check_system_tsc_reliable(); > > > - > > What kind of patch is that? Definitely nothing which can be applied. > To avoid using unassigned variable tsc_clocksource_reliable. > Or what's the purpose of if (tsc_clocksource_reliable) check in > unsynchronized_tsc()? That's not the question. The patch format itself is broken: @@ -1412,11 +1412,11 @@ void __init tsc_init(void) use_tsc_delay(); + check_system_tsc_reliable(); + if (unsynchronized_tsc()) mark_tsc_unstable("TSCs unsynchronized"); - check_system_tsc_reliable(); - That is not a patch created with diff -u or any other mechanism which creates properly formatted patches. Thanks, tglx --8323329-1206976284-1497964466=:1869--