Re: CONFIG_PRINTK_TIME woes

Tony Lindgren
2005-08-23T07:19:07Z

* Andrew Morton <akpm@osdl.org> [050821 02:15]:
> "Luck, Tony" <tony.luck@intel.com> wrote:
> >
> > It has been pointed out to me that ia64 doesn't boot
> > with CONFIG_PRINTK_TIME=y. The issue is the call to
> > sched_clock() ... which on ia64 accesses some per-cpu
> > data to adjust for possible variations in processor
> > speed between different cpus. Since the per-cpu page
> > is not set up for the first few printk() calls, we die.
> >
> > Is this an issue on any other architecture? Most versions
> > of sched_clock() seem to just scale jiffies into nanoseconds,
> > so I guess they don't. s390, sparc64, x86 and x86_64 all
> > have more sophisticated versions but they don't appear to me
> > to have limitations on how early they might be called.

CONFIG_PRINTK_TIME also has a problem on at least ARM OMAP where
the IO mapping to read the clock may not be initialized when
sched_clock() is called for the first time.

I'd hate to have to test for something for CONFIG_PRINTK_TIME
every time sched_clock() is being called.

The quick fix would seem to be to only allow CONFIG_PRINTK_TIME
from kernel cmdline to make it happen a bit later. So basically
make int printk_time = 0 until command line is evaluated.

Tony