[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4BFD4AC9.6080602@tilera.com>
Date: Wed, 26 May 2010 12:22:33 -0400
From: Chris Metcalf <cmetcalf@...era.com>
To: Thomas Gleixner <tglx@...utronix.de>
CC: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [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.
http://www.tilera.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists