From mboxrd@z Thu Jan 1 00:00:00 1970 From: Petr Mladek Subject: Re: [PATCH 00/50] Add log level to show_stack() Date: Wed, 6 Nov 2019 09:35:38 +0100 Message-ID: <20191106083538.z5nlpuf64cigxigh@pathway.suse.cz> References: <20191106030542.868541-1-dima@arista.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZOUbIOndllY52PxyI7VeQqPjnhXSLOqlOyt0VDWf/Bs=; b=IDXvMO3rZIZ96V vEW765ZBN89Cfyp5ho7guY50vx73+sR9SiVctpT8XFOjyd7JNF9lZtAmXOEBrf3DsgJgt8SWpfgQF MqzbnVRgsKAUI6quRxHbUP3S5VG+1nqzfTZzZHQAOYmDvoD1PgFdj3oSTnkuOTYNBSATC8MkoC6SB 2jD4g/xU9TUBntT8T3Q0ZlR2/q4eiTN1YwQjzb2+HZlC781SpgqzZ+VA7MTm1n3Tb40BKmja5dxxN cEkjW2sa4zIq/avgP9AKYVIwqTmtrme49sx5wIf4eScse6kPrtf3OIZ0ykh6GuItL2A4nkj/Yu26t xpvownzCwiFismB3Tm3Q==; Content-Disposition: inline In-Reply-To: <20191106030542.868541-1-dima@arista.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+glpr-linux-riscv=m.gmane.org@lists.infradead.org To: Dmitry Safonov Cc: Juri Lelli , linux-sh@vger.kernel.org, Catalin Marinas , Ben Segall , Guo Ren , Pavel Machek , Vincent Guittot , Paul Burton , Michael Ellerman , Geert Uytterhoeven , Mel Gorman , Jiri Slaby , Matt Turner , uclinux-h8-devel@lists.sourceforge.jp, Len Brown , linux-pm@vger.kernel.org, Heiko Carstens , linux-um@lists.infradead.org, Thomas Gleixner , Dietmar Eggemann , Richard Henderson , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Ralf Baechle On Wed 2019-11-06 03:04:51, Dmitry Safonov wrote: > Add log level argument to show_stack(). > Done in three stages: > 1. Introducing show_stack_loglvl() for every architecture > 2. Migrating old users with an explicit log level > 3. Renaming show_stack_loglvl() into show_stack() > > Justification: > o It's a design mistake to move a business-logic decision > into platform realization detail. > o I have currently two patches sets that would benefit from this work: > Removing console_loglevel jumps in sysrq driver [1] Just to clarify. The problem in sysrq driver is a bit different. It modifies console_loglevel to show even less important message on the console. IMHO, it should be solved by printing the header line with pr_error(). It is not ideal. A cleaner solution might be to introduce another loglevel that will always get pushed to the console. But I am not sure if it is worth this single line. > Hung task warning before panic [2] - suggested by Tetsuo (but he > probably didn't realise what it would involve). > o While doing (1), (2) the backtraces were adjusted to headers > and other messages for each situation - so there won't be a situation > when the backtrace is printed, but the headers are missing because > they have lesser log level (or the reverse). > o As the result in (2) plays with console_loglevel for kdb are removed. > The least important for upstream, but maybe still worth to note that > every company I've worked in so far had an off-list patch to print > backtrace with the needed log level (but only for the architecture they > cared about). > If you have other ideas how you will benefit from show_stack() with > a log level - please, reply to this cover letter. I agree with all the other justification. I would add. The backtrace is really useful for debugging. It should be possible to print it even in less critical situations. I am afraid that many people use WARN() for this purpose. But WARN() is not always appropriate. WARN() misuse huts when panic_on_warn option is used. Best Regards, Petr