• Sergey Senozhatsky's avatar
    printk: remove zap_locks() function · 8b1742c9
    Sergey Senozhatsky authored
    We use printk-safe now which makes printk-recursion detection code
    in vprintk_emit() unreachable. The tricky thing here is that, apart
    from detecting and reporting printk recursions, that code also used
    to zap_locks() in case of panic() from the same CPU. However,
    zap_locks() does not look to be needed anymore:
    
    1) Since commit 08d78658 ("panic: release stale console lock to
       always get the logbuf printed out") panic flushing of `logbuf' to
       console ignores the state of `console_sem' by doing
       	panic()
    		console_trylock();
    		console_unlock();
    
    2) Since commit cf9b1106 ("printk/nmi: flush NMI messages on the
       system panic") panic attempts to zap the `logbuf_lock' spin_lock to
       successfully flush nmi messages to `logbuf'.
    
    Basically, it seems that we either already do what zap_locks() used to
    do but in other places or we ignore the state of the lock. The only
    reaming difference is that we don't re-init the console semaphore in
    printk_safe_flush_on_panic(), but this is not necessary because we
    don't call console drivers from printk_safe_flush_on_panic() due to
    the fact that we are using a deferred printk() version (as was
    suggested by Petr Mladek).
    
    Link: http://lkml.kernel.org/r/20161227141611.940-8-sergey.senozhatsky@gmail.com
    
    
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Jan Kara <jack@suse.cz>
    Cc: Tejun Heo <tj@kernel.org>
    Cc: Calvin Owens <calvinowens@fb.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Peter Hurley <peter@hurleysoftware.com>
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
    Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
    8b1742c9
printk.c 78.3 KB