From 67e2be02328b9a61a9c799fbdd4ec94d7da0c323 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Thu, 20 Dec 2007 15:01:17 +0100 Subject: sched: rt: account the cpu time during the tick Realtime tasks would not account their runtime during ticks. Which would lead to: struct sched_param param = { .sched_priority = 10 }; pthread_setschedparam(pthread_self(), SCHED_FIFO, ¶m); while (1) ; Not showing up in top. Signed-off-by: Peter Zijlstra Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- kernel/sched_rt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index ee9c8b6529e9..9ba3daa03475 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -208,6 +208,8 @@ move_one_task_rt(struct rq *this_rq, int this_cpu, struct rq *busiest, static void task_tick_rt(struct rq *rq, struct task_struct *p) { + update_curr_rt(rq); + /* * RR tasks need a special form of timeslice management. * FIFO tasks have no timeslices. -- cgit v1.2.1 From 2c3b20e91fe3a083c5d9bc79437c485866ea251c Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Thu, 20 Dec 2007 15:01:17 +0100 Subject: debug: add end-of-oops marker Right now it's nearly impossible for parsers that collect kernel crashes from logs or emails (such as www.kerneloops.org) to detect the end-of-oops condition. In addition, it's not currently possible to detect whether or not 2 oopses that look alike are actually the same oops reported twice, or are truly two unique oopses. This patch adds an end-of-oops marker, and makes the end marker include a very simple 64-bit random ID to be able to detect duplicate reports. Normally, this ID is calculated as a late_initcall() (in the hope that at that time there is enough entropy to get a unique enough ID); however for early oopses the oops_exit() function needs to generate the ID on the fly. We do this all at the _end_ of an oops printout, so this does not impact our ability to get the most important portions of a crash out to the console first. [ Sidenote: the already existing oopses-since-bootup counter we print during crashes serves as the differentiator between multiple oopses that trigger during the same bootup. ] Tested on 32-bit and 64-bit x86. Artificially injected very early crashes as well, as expected they result in this constant ID after multiple bootups: ---[ end trace ca143223eefdc828 ]--- ---[ end trace ca143223eefdc828 ]--- because the random pools are still all zero. But it all still works fine and causes no additional problems (which is the main goal of instrumentation code). Signed-off-by: Arjan van de Ven Signed-off-by: Ingo Molnar --- kernel/panic.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/kernel/panic.c b/kernel/panic.c index 6f6e03e91595..da4d6bac270e 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -19,6 +19,7 @@ #include #include #include +#include int panic_on_oops; int tainted; @@ -265,6 +266,20 @@ void oops_enter(void) do_oops_enter_exit(); } +/* + * 64-bit random ID for oopses: + */ +static u64 oops_id; + +static int init_oops_id(void) +{ + if (!oops_id) + get_random_bytes(&oops_id, sizeof(oops_id)); + + return 0; +} +late_initcall(init_oops_id); + /* * Called when the architecture exits its oops handler, after printing * everything. @@ -272,6 +287,9 @@ void oops_enter(void) void oops_exit(void) { do_oops_enter_exit(); + init_oops_id(); + printk(KERN_WARNING "---[ end trace %016llx ]---\n", + (unsigned long long)oops_id); } #ifdef CONFIG_CC_STACKPROTECTOR -- cgit v1.2.1