diff options
author | Sergey Senozhatsky <[email protected]> | 2016-03-17 14:21:23 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2016-03-17 15:09:34 -0700 |
commit | 6b97a20d3a7909daa06625d4440c2c52d7bf08d7 (patch) | |
tree | aa794a72f34aceddfaacea169feec753460ab889 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | a8199371afc27946d72f0d53e938e78d2ea0bae3 (diff) |
printk: set may_schedule for some of console_trylock() callers
console_unlock() allows to cond_resched() if its caller has set
`console_may_schedule' to 1, since 8d91f8b15361 ("printk: do
cond_resched() between lines while outputting to consoles").
The rules are:
-- console_lock() always sets `console_may_schedule' to 1
-- console_trylock() always sets `console_may_schedule' to 0
However, console_trylock() callers (among them is printk()) do not
always call printk() from atomic contexts, and some of them can
cond_resched() in console_unlock(), so console_trylock() can set
`console_may_schedule' to 1 for such processes.
For !CONFIG_PREEMPT_COUNT kernels, however, console_trylock() always
sets `console_may_schedule' to 0.
It's possible to drop explicit preempt_disable()/preempt_enable() in
vprintk_emit(), because console_unlock() and console_trylock() are now
smart enough:
a) console_unlock() does not cond_resched() when it's unsafe
(console_trylock() takes care of that)
b) console_unlock() does can_use_console() check.
Signed-off-by: Sergey Senozhatsky <[email protected]>
Reviewed-by: Petr Mladek <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Kyle McMartin <[email protected]>
Cc: Dave Jones <[email protected]>
Cc: Calvin Owens <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions