From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752985AbcLLQha (ORCPT ); Mon, 12 Dec 2016 11:37:30 -0500 Received: from mx2.suse.de ([195.135.220.15]:49381 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752186AbcLLQh3 (ORCPT ); Mon, 12 Dec 2016 11:37:29 -0500 Date: Mon, 12 Dec 2016 17:37:27 +0100 From: Petr Mladek To: Sergey Senozhatsky Cc: Andrew Morton , Jan Kara , Tejun Heo , Calvin Owens , Thomas Gleixner , Steven Rostedt , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , Linus Torvalds , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [RFC][PATCHv5 7/7] printk: remove zap_locks() function Message-ID: <20161212163727.GF2441@pathway.suse.cz> References: <20161201135546.15549-1-sergey.senozhatsky@gmail.com> <20161201135546.15549-8-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161201135546.15549-8-sergey.senozhatsky@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2016-12-01 22:55:46, Sergey Senozhatsky wrote: > 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 08d78658f393 ("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 cf9b1106c81c ("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). > > Signed-off-by: Sergey Senozhatsky I like this patch. The code is unused after protecting the section by printk_safe_enter()/exit(). And also the panic mode is handled by the commits mentioned above. Reviewed-by: Petr Mladek Best Regards, Petr