diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2012-02-27 04:47:00 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-03-12 15:43:16 -0400 |
commit | 3ccf3e8306156a28213adc720aba807e9a901ad5 (patch) | |
tree | 5b9db344b702299ea7eb53fbff3d0d74707d40ec /kernel/sched | |
parent | 554cecaf733623b327eef9652b65965eb1081b81 (diff) |
printk/sched: Introduce special printk_sched() for those awkward moments
There's a few awkward printk()s inside of scheduler guts that people
prefer to keep but really are rather deadlock prone. Fudge around it
by storing the text in a per-cpu buffer and poll it using the existing
printk_tick() handler.
This will drop output when its more frequent than once a tick, however
only the affinity thing could possible go that fast and for that just
one should suffice to notify the admin he's done something silly..
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/n/tip-wua3lmkt3dg8nfts66o6brne@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/core.c | 2 | ||||
-rw-r--r-- | kernel/sched/rt.c | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index b1ccce819ce2..8781cec7c3e6 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -1284,7 +1284,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p) | |||
1284 | * leave kernel. | 1284 | * leave kernel. |
1285 | */ | 1285 | */ |
1286 | if (p->mm && printk_ratelimit()) { | 1286 | if (p->mm && printk_ratelimit()) { |
1287 | printk(KERN_INFO "process %d (%s) no longer affine to cpu%d\n", | 1287 | printk_sched("process %d (%s) no longer affine to cpu%d\n", |
1288 | task_pid_nr(p), p->comm, cpu); | 1288 | task_pid_nr(p), p->comm, cpu); |
1289 | } | 1289 | } |
1290 | 1290 | ||
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 7f7e7cdcb472..b60dad720173 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c | |||
@@ -864,8 +864,14 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq) | |||
864 | * but accrue some time due to boosting. | 864 | * but accrue some time due to boosting. |
865 | */ | 865 | */ |
866 | if (likely(rt_b->rt_runtime)) { | 866 | if (likely(rt_b->rt_runtime)) { |
867 | static bool once = false; | ||
868 | |||
867 | rt_rq->rt_throttled = 1; | 869 | rt_rq->rt_throttled = 1; |
868 | printk_once(KERN_WARNING "sched: RT throttling activated\n"); | 870 | |
871 | if (!once) { | ||
872 | once = true; | ||
873 | printk_sched("sched: RT throttling activated\n"); | ||
874 | } | ||
869 | } else { | 875 | } else { |
870 | /* | 876 | /* |
871 | * In case we did anyway, make it go away, | 877 | * In case we did anyway, make it go away, |