From 3e51f33fcc7f55e6df25d15b55ed10c8b4da84cd Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Sat, 3 May 2008 18:29:28 +0200 Subject: sched: add optional support for CONFIG_HAVE_UNSTABLE_SCHED_CLOCK this replaces the rq->clock stuff (and possibly cpu_clock()). - architectures that have an 'imperfect' hardware clock can set CONFIG_HAVE_UNSTABLE_SCHED_CLOCK - the 'jiffie' window might be superfulous when we update tick_gtod before the __update_sched_clock() call in sched_clock_tick() - cpu_clock() might be implemented as: sched_clock_cpu(smp_processor_id()) if the accuracy proves good enough - how far can TSC drift in a single jiffie when considering the filtering and idle hooks? [ mingo@elte.hu: various fixes and cleanups ] Signed-off-by: Peter Zijlstra Signed-off-by: Ingo Molnar --- init/main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'init/main.c') diff --git a/init/main.c b/init/main.c index a87d4ca5c36c..ddada7acf363 100644 --- a/init/main.c +++ b/init/main.c @@ -602,6 +602,7 @@ asmlinkage void __init start_kernel(void) softirq_init(); timekeeping_init(); time_init(); + sched_clock_init(); profile_init(); if (!irqs_disabled()) printk("start_kernel(): bug: interrupts were enabled early\n"); -- cgit 1.4.1 From e662e1cfd434aa234b72fbc781f1d70211cb785b Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Mon, 12 May 2008 14:02:22 -0700 Subject: init: don't lose initcall return values There is an ability to lose an initcall return value if it happened with irq disabled or imbalanced preemption (and if we debug initcall). Signed-off-by: Cyrill Gorcunov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- init/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'init/main.c') diff --git a/init/main.c b/init/main.c index ddada7acf363..f406fefa626c 100644 --- a/init/main.c +++ b/init/main.c @@ -702,7 +702,6 @@ static void __init do_initcalls(void) for (call = __initcall_start; call < __initcall_end; call++) { ktime_t t0, t1, delta; - char *msg = NULL; char msgbuf[40]; int result; @@ -724,22 +723,23 @@ static void __init do_initcalls(void) (unsigned long long) delta.tv64 >> 20); } - if (result && result != -ENODEV && initcall_debug) { - sprintf(msgbuf, "error code %d", result); - msg = msgbuf; - } + msgbuf[0] = 0; + + if (result && result != -ENODEV && initcall_debug) + sprintf(msgbuf, "error code %d ", result); + if (preempt_count() != count) { - msg = "preemption imbalance"; + strncat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); preempt_count() = count; } if (irqs_disabled()) { - msg = "disabled interrupts"; + strncat(msgbuf, "disabled interrupts ", sizeof(msgbuf)); local_irq_enable(); } - if (msg) { + if (msgbuf[0]) { print_fn_descriptor_symbol(KERN_WARNING "initcall %s()", (unsigned long) *call); - printk(" returned with %s\n", msg); + printk(" returned with %s\n", msgbuf); } } -- cgit 1.4.1