Skip to content

Commit

Permalink
printk: remove outdated comment
Browse files Browse the repository at this point in the history
Comment about interesting interlocking between lockbuf_lock and
console_sem is outdated.

It was added in 2002 by commit a880f45 during conversion of
console_lock to console_sem + lockbuf_lock.

At that time release_console_sem() (today's equivalent is
console_unlock()) was indeed using lockbuf_lock to avoid races between
trylock on console_sem in printk() and unlock of console_sem.  However
these days the interlocking is gone and the races are avoided by
rechecking logbuf state after releasing console_sem.

Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jankara authored and torvalds committed Jun 4, 2014
1 parent 034633c commit ca1d432
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/printk/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ struct printk_log {
};

/*
* The logbuf_lock protects kmsg buffer, indices, counters. It is also
* used in interesting ways to provide interlocking in console_unlock();
* The logbuf_lock protects kmsg buffer, indices, counters.
*/
static DEFINE_RAW_SPINLOCK(logbuf_lock);

Expand Down

0 comments on commit ca1d432

Please sign in to comment.