Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-13 Thread Feng Tang
On Wed, Jun 06, 2018 at 05:38:33PM +0800, Feng Tang wrote: > On Sat, Jun 02, 2018 at 12:12:13AM +0800, Feng Tang wrote: > > Hi Peter and all, > > > > Hi Peter and Petr, > > > > Thanks for your suggestions, will try to find a cleaner and less hacky way, > > and it may take some time as dealing

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-13 Thread Feng Tang
On Wed, Jun 06, 2018 at 05:38:33PM +0800, Feng Tang wrote: > On Sat, Jun 02, 2018 at 12:12:13AM +0800, Feng Tang wrote: > > Hi Peter and all, > > > > Hi Peter and Petr, > > > > Thanks for your suggestions, will try to find a cleaner and less hacky way, > > and it may take some time as dealing

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-06 Thread Feng Tang
Hi Pavel, Thanks for the revew. On Wed, Jun 06, 2018 at 11:25:22AM -0400, Pavel Tatashin wrote: > Hi Feng, > > Using a global variable for this is not going to work, because you are adding > a conditional branch and a load to a very hot path for the live of the > system, not only for the

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-06 Thread Feng Tang
Hi Pavel, Thanks for the revew. On Wed, Jun 06, 2018 at 11:25:22AM -0400, Pavel Tatashin wrote: > Hi Feng, > > Using a global variable for this is not going to work, because you are adding > a conditional branch and a load to a very hot path for the live of the > system, not only for the

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-06 Thread Pavel Tatashin
Hi Feng, Using a global variable for this is not going to work, because you are adding a conditional branch and a load to a very hot path for the live of the system, not only for the duration of the boot. Pavel > > +int tsc_inited; > /* > * TSC can be unstable due to cpufreq or due to

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-06 Thread Pavel Tatashin
Hi Feng, Using a global variable for this is not going to work, because you are adding a conditional branch and a load to a very hot path for the live of the system, not only for the duration of the boot. Pavel > > +int tsc_inited; > /* > * TSC can be unstable due to cpufreq or due to

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-06 Thread Feng Tang
On Sat, Jun 02, 2018 at 12:12:13AM +0800, Feng Tang wrote: Hi Peter and all, > Hi Peter and Petr, > > Thanks for your suggestions, will try to find a cleaner and less hacky way, > and it may take some time as dealing with all kinds of TSC is tricky :) > > - Feng > > On Thu, May 31, 2018 at

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-06 Thread Feng Tang
On Sat, Jun 02, 2018 at 12:12:13AM +0800, Feng Tang wrote: Hi Peter and all, > Hi Peter and Petr, > > Thanks for your suggestions, will try to find a cleaner and less hacky way, > and it may take some time as dealing with all kinds of TSC is tricky :) > > - Feng > > On Thu, May 31, 2018 at

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-01 Thread Pavel Tatashin
Hi Peter, How about taking patches 1-4 and 7 ? I can work on patches 5 & 6 separetly to provide a better integration for x86, this can be decided separetly but the other patches will enable early clock functionality on arches where sched_clock() is available early. Pavel On Thu, May 31, 2018 at

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-01 Thread Pavel Tatashin
Hi Peter, How about taking patches 1-4 and 7 ? I can work on patches 5 & 6 separetly to provide a better integration for x86, this can be decided separetly but the other patches will enable early clock functionality on arches where sched_clock() is available early. Pavel On Thu, May 31, 2018 at

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-01 Thread Feng Tang
Hi Peter and Petr, Thanks for your suggestions, will try to find a cleaner and less hacky way, and it may take some time as dealing with all kinds of TSC is tricky :) - Feng On Thu, May 31, 2018 at 05:52:10PM +0200, Peter Zijlstra wrote: > On Thu, May 31, 2018 at 03:55:42PM +0200, Petr Mladek

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-01 Thread Feng Tang
Hi Peter and Petr, Thanks for your suggestions, will try to find a cleaner and less hacky way, and it may take some time as dealing with all kinds of TSC is tricky :) - Feng On Thu, May 31, 2018 at 05:52:10PM +0200, Peter Zijlstra wrote: > On Thu, May 31, 2018 at 03:55:42PM +0200, Petr Mladek

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-05-31 Thread Peter Zijlstra
On Thu, May 31, 2018 at 03:55:42PM +0200, Petr Mladek wrote: > I wonder if we could get some cleaner integration into the timer and > printk code. Yes, these patches are particularly horrific.. There were some earlier patches by Pavel Tatashin, which attempted do get things running earlier.

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-05-31 Thread Peter Zijlstra
On Thu, May 31, 2018 at 03:55:42PM +0200, Petr Mladek wrote: > I wonder if we could get some cleaner integration into the timer and > printk code. Yes, these patches are particularly horrific.. There were some earlier patches by Pavel Tatashin, which attempted do get things running earlier.

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-05-31 Thread Petr Mladek
On Wed 2018-05-30 17:20:59, Feng Tang wrote: > To show time info in kernel log earlier and help optimizing kernel > boot time, printk adds a debug hook "boot_printk_clock_fn()" for > capable platform which has accurate clock in early boot phase. > > This patch will add early param setup option,

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-05-31 Thread Petr Mladek
On Wed 2018-05-30 17:20:59, Feng Tang wrote: > To show time info in kernel log earlier and help optimizing kernel > boot time, printk adds a debug hook "boot_printk_clock_fn()" for > capable platform which has accurate clock in early boot phase. > > This patch will add early param setup option,

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-05-30 Thread Feng Tang
Hi Andy, Thanks for the review. On Wed, May 30, 2018 at 04:25:07PM +0300, Andy Shevchenko wrote: > On Wed, May 30, 2018 at 12:20 PM, Feng Tang wrote: > > To show time info in kernel log earlier and help optimizing kernel > > boot time, printk adds a debug hook "boot_printk_clock_fn()" for > >

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-05-30 Thread Feng Tang
Hi Andy, Thanks for the review. On Wed, May 30, 2018 at 04:25:07PM +0300, Andy Shevchenko wrote: > On Wed, May 30, 2018 at 12:20 PM, Feng Tang wrote: > > To show time info in kernel log earlier and help optimizing kernel > > boot time, printk adds a debug hook "boot_printk_clock_fn()" for > >

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-05-30 Thread Andy Shevchenko
On Wed, May 30, 2018 at 12:20 PM, Feng Tang wrote: > To show time info in kernel log earlier and help optimizing kernel > boot time, printk adds a debug hook "boot_printk_clock_fn()" for > capable platform which has accurate clock in early boot phase. > > This patch will add early param setup

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-05-30 Thread Andy Shevchenko
On Wed, May 30, 2018 at 12:20 PM, Feng Tang wrote: > To show time info in kernel log earlier and help optimizing kernel > boot time, printk adds a debug hook "boot_printk_clock_fn()" for > capable platform which has accurate clock in early boot phase. > > This patch will add early param setup

[RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-05-30 Thread Feng Tang
To show time info in kernel log earlier and help optimizing kernel boot time, printk adds a debug hook "boot_printk_clock_fn()" for capable platform which has accurate clock in early boot phase. This patch will add early param setup option, so that user can chose to provide a tsc based early

[RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-05-30 Thread Feng Tang
To show time info in kernel log earlier and help optimizing kernel boot time, printk adds a debug hook "boot_printk_clock_fn()" for capable platform which has accurate clock in early boot phase. This patch will add early param setup option, so that user can chose to provide a tsc based early