[lkml]   [2010]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] arch/tile: new multi-core architecture for Linux
On 5/25/2010 4:12 PM, Thomas Gleixner wrote:
> +unsigned long long sched_clock(void)
> +{
> + u64 cycles;
> + u32 cyc_hi, cyc_lo;
> +
> + if (unlikely(cyc2ns_mult == 0))
> + setup_clock();
> Please initialize stuff _before_ it is called the first time and not
> at some arbitrary point conditionally in a hotpath.

Looking more closely at this, the reason for this lazy initialization
was that sched_clock() can be called from lockdep_init(), which runs way
before any tasteful architecture-specific initialization can happen.
Perhaps the correct model is that during the early stages of boot, we
are happy to shift by zero, multiply by zero, and claim the time is zero :-)

Chris Metcalf, Tilera Corp.

 \ /
  Last update: 2010-05-26 18:25    [W:0.248 / U:16.620 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site