lkml.org 
[lkml]   [2021]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/tsc: mark tsc reliable for qualified platforms
On Tue, Mar 02, 2021 at 10:14:01AM +0100, Peter Zijlstra wrote:
> On Tue, Mar 02, 2021 at 10:52:52AM +0800, Feng Tang wrote:
> > @@ -1193,6 +1193,17 @@ static void __init check_system_tsc_reliable(void)
> > #endif
> > if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE))
> > tsc_clocksource_reliable = 1;
> > +
> > + /*
> > + * Ideally the socket number should be checked, but this is called
> > + * by tsc_init() which is in early boot phase and the socket numbers
> > + * may not be available. Use 'nr_online_nodes' as a fallback solution
> > + */
> > + if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC)
> > + && boot_cpu_has(X86_FEATURE_NONSTOP_TSC)
> > + && boot_cpu_has(X86_FEATURE_TSC_ADJUST)
> > + && nr_online_nodes <= 2)
> > + tsc_clocksource_reliable = 1;
>
> Logical operators go at the end of a line and alignment is with the (,
> not the code block after it.

Thanks for pointing out and the suggestion! Will change it to

if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC) &&
boot_cpu_has(X86_FEATURE_NONSTOP_TSC) &&
boot_cpu_has(X86_FEATURE_TSC_ADJUST) &&
nr_online_nodes <= 2)
tsc_clocksource_reliable = 1;

- Feng

\
 
 \ /
  Last update: 2021-03-02 17:09    [W:0.089 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site