[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1243441525.28705.19.camel@desktop>
Date: Wed, 27 May 2009 09:25:25 -0700
From: Daniel Walker <dwalker@...o99.com>
To: Paul Mundt <lethal@...ux-sh.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Linus Walleij <linus.ml.walleij@...il.com>,
Ingo Molnar <mingo@...e.hu>,
Andrew Victor <linux@...im.org.za>,
Haavard Skinnemoen <hskinnemoen@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-sh@...r.kernel.org,
linux-arm-kernel@...ts.arm.linux.org.uk,
John Stultz <johnstul@...ux.vnet.ibm.com>
Subject: Re: [PATCH] sched: Support current clocksource handling in
fallback sched_clock().
On Wed, 2009-05-27 at 09:15 +0900, Paul Mundt wrote:
> unsigned long long __attribute__((weak)) sched_clock(void)
> {
> + /*
> + * Use the current clocksource when it becomes available later in
> + * the boot process, and ensure that it is usable for sched_clock().
> + */
> + if (clock && (clock->flags & CLOCK_SOURCE_USE_FOR_SCHED_CLOCK))
> + return cyc2ns(clock, clocksource_read(clock));
> +
> + /* Otherwise just fall back on jiffies */
> return (unsigned long long)(jiffies - INITIAL_JIFFIES)
Do we really need all this complexity in a fast path? the jiffies
clocksource is static and always ready. Could we instead remove the
usage of "clock" and create a new pointer called "sched_clocksource" and
initialize it to the jiffies clock, and allow the clocksource management
code to update that new pointer based on the
CLOCK_SOURCE_USE_FOR_SCHED_CLOCK flag when new clocksources are
registered/removed/marked unstable etc..
that would eliminate all the code in sched_clock except one line,
unsigned long long __attribute__((weak)) sched_clock(void)
{
return cyc2ns(sched_clocksource, clocksource_read(sched_clocksource));
}
Daniel
--
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