diff options
| author | Jan Kara <[email protected]> | 2014-06-04 23:11:37 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2014-06-04 23:54:17 +0000 |
| commit | 939f04bec1a4ef6ba4370b0f34b01decc844b1b1 (patch) | |
| tree | 1da1d9914daa6d19813589502f458c7a24e737e0 /lib/string.c | |
| parent | printk: fix lockdep instrumentation of console_sem (diff) | |
| download | kernel-939f04bec1a4ef6ba4370b0f34b01decc844b1b1.tar.gz kernel-939f04bec1a4ef6ba4370b0f34b01decc844b1b1.zip | |
printk: enable interrupts before calling console_trylock_for_printk()
We need interrupts disabled when calling console_trylock_for_printk()
only so that cpu id we pass to can_use_console() remains valid (for
other things console_sem provides all the exclusion we need and
deadlocks on console_sem due to interrupts are impossible because we use
down_trylock()). However if we are rescheduled, we are guaranteed to
run on an online cpu so we can easily just get the cpu id in
can_use_console().
We can lose a bit of performance when we enable interrupts in
vprintk_emit() and then disable them again in console_unlock() but OTOH
it can somewhat reduce interrupt latency caused by console_unlock()
especially since later in the patch series we will want to spin on
console_sem in console_trylock_for_printk().
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/string.c')
0 files changed, 0 insertions, 0 deletions
