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 /include/linux/printk.h | |
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 'include/linux/printk.h')
-rw-r--r-- | include/linux/printk.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h index f0e22f75143f..1f77a4174ee0 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -101,6 +101,11 @@ asmlinkage __printf(1, 2) __cold | |||
101 | int printk(const char *fmt, ...); | 101 | int printk(const char *fmt, ...); |
102 | 102 | ||
103 | /* | 103 | /* |
104 | * Special printk facility for scheduler use only, _DO_NOT_USE_ ! | ||
105 | */ | ||
106 | __printf(1, 2) __cold int printk_sched(const char *fmt, ...); | ||
107 | |||
108 | /* | ||
104 | * Please don't use printk_ratelimit(), because it shares ratelimiting state | 109 | * Please don't use printk_ratelimit(), because it shares ratelimiting state |
105 | * with all other unrelated printk_ratelimit() callsites. Instead use | 110 | * with all other unrelated printk_ratelimit() callsites. Instead use |
106 | * printk_ratelimited() or plain old __ratelimit(). | 111 | * printk_ratelimited() or plain old __ratelimit(). |
@@ -127,6 +132,11 @@ int printk(const char *s, ...) | |||
127 | { | 132 | { |
128 | return 0; | 133 | return 0; |
129 | } | 134 | } |
135 | static inline __printf(1, 2) __cold | ||
136 | int printk_sched(const char *s, ...) | ||
137 | { | ||
138 | return 0; | ||
139 | } | ||
130 | static inline int printk_ratelimit(void) | 140 | static inline int printk_ratelimit(void) |
131 | { | 141 | { |
132 | return 0; | 142 | return 0; |