From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756674AbcLANPo (ORCPT ); Thu, 1 Dec 2016 08:15:44 -0500 Received: from mx2.suse.de ([195.135.220.15]:34549 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754235AbcLANPn (ORCPT ); Thu, 1 Dec 2016 08:15:43 -0500 Date: Thu, 1 Dec 2016 14:15:39 +0100 From: Petr Mladek To: Sergey Senozhatsky Cc: Andrew Morton , Jan Kara , Tejun Heo , Calvin Owens , Thomas Gleixner , Mel Gorman , Steven Rostedt , Ingo Molnar , Peter Zijlstra , Laura Abbott , Andy Lutomirski , Linus Torvalds , Kees Cook , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [RFC][PATCHv4 6/6] printk: remove zap_locks() function Message-ID: <20161201131539.GO21230@pathway.suse.cz> References: <20161027154933.1211-1-sergey.senozhatsky@gmail.com> <20161027154933.1211-7-sergey.senozhatsky@gmail.com> <20161125150113.GJ24103@pathway.suse.cz> <20161201125045.GA404@tigerII> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161201125045.GA404@tigerII> 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 21:50:45, Sergey Senozhatsky wrote: > On (11/25/16 16:01), Petr Mladek wrote: > [..] > > > apart from detecting and reporting printk recursions, that code also > > > used to zap_lockc() in case of panic. However, zap_locks() does not > > ^ > > > > s/zap_lockc/zap_locks/ > > > > > 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'. > > > > Note that the same code is newly used to flush also the printk_safe > > per-CPU buffers. It means that logbuf_lock is zapped also when > > flushing these new buffers. > > > not quite. there are several checks that would prevent multiple logbuf_lock > re-inits: Ah, I did not meant that the lock was zapped twice. I wanted to say that we added a new path and that it was handled as well :-) Best Regards, Petr