Re: [PATCH 1/2] x86/tsc: Avoid a double call if TSC initializes earlier.

2018-07-30 Thread Pavel Tatashin
On Mon, Jul 30, 2018 at 3:55 AM Dou Liyang wrote: > > static_branch_enable(&__use_tsc) may be called twice in common case, that > is redundant. And there are also some common functions both in > tsc_early_init() and tsc_init(). > > Move them into a separate helper function, only call it once. > Al

Re: [PATCH 1/2] x86/tsc: Avoid a double call if TSC initializes earlier.

2018-07-30 Thread Dou Liyang
Hi Peter, At 07/30/2018 05:34 PM, Peter Zijlstra wrote: On Mon, Jul 30, 2018 at 03:54:20PM +0800, Dou Liyang wrote: static_branch_enable(&__use_tsc) may be called twice in common case, that is redundant. It is also really not a problem... Yes, right. Just avoid the second useless setting.

Re: [PATCH 1/2] x86/tsc: Avoid a double call if TSC initializes earlier.

2018-07-30 Thread Peter Zijlstra
On Mon, Jul 30, 2018 at 03:54:20PM +0800, Dou Liyang wrote: > static_branch_enable(&__use_tsc) may be called twice in common case, that > is redundant. It is also really not a problem...

[PATCH 1/2] x86/tsc: Avoid a double call if TSC initializes earlier.

2018-07-30 Thread Dou Liyang
static_branch_enable(&__use_tsc) may be called twice in common case, that is redundant. And there are also some common functions both in tsc_early_init() and tsc_init(). Move them into a separate helper function, only call it once. Also fix comments: -s/authorative/authoritative -s/cyc2ns_init/t