lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120207090609.GB4852@aftab>
Date:	Tue, 7 Feb 2012 10:06:09 +0100
From:	Borislav Petkov <bp@...64.org>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Venki Pallipadi <venki@...gle.com>, Borislav Petkov <bp@...64.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Stephane Eranian <eranian@...gle.com>,
	linux-kernel@...r.kernel.org, acme@...hat.com,
	robert.richter@....com, eric.dumazet@...il.com,
	Andreas Herrmann <andreas.herrmann3@....com>
Subject: Re: [BUG] perf: perf sched warning possibly due to clock granularity
 on AMD

On Tue, Feb 07, 2012 at 09:32:53AM +0100, Ingo Molnar wrote:
> > Yes. If these two flags are set, TSC should be consistent and 
> > sched_clock_stable could be set and it will be reset if there 
> > is a call to mark_tsc_unstable().
> 
> Most of the details swapped out from my brain meanwhile, but I 
> have some vague memories of a DMI quirk for some high-end system 
> that just did a sched_clock_stable = 0 or such.
> 
> So if the common case is that the TSC is entirely synchronized 
> across CPUs, then we can default to that and rely on platform 
> initialization code or DMI quirks setting the few large-NUMA 
> systems to an unstable TSC.

There's also 14be1f7454ea96ee614467a49cf018a1a383b189 which removed
the setting of sched_clock_stable to 1 due to UV systems not being
TSC-synchronized across blades.

I guess, we could tentatively enable it on AMD provided nothing has
marked the TSC as unstable already:

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index f4773f4..ddee619 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -456,6 +456,8 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
        if (c->x86_power & (1 << 8)) {
                set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
                set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
+               if (!check_tsc_unstable())
+                       sched_clock_stable = 1;
        }
 
 #ifdef CONFIG_X86_64

Hmm...

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ