From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH 00/50] Add log level to show_stack() Date: Wed, 6 Nov 2019 21:34:40 +0100 Message-ID: <20191106203440.GH3079@worktop.programming.kicks-ass.net> References: <20191106030542.868541-1-dima@arista.com> <20191106092039.GT4131@hirez.programming.kicks-ass.net> <10db6fa1-5b17-ebe6-09e0-6335e09e4db8@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=dHJkce5Y8yfg5pe60m9jFt8qJncDRir6BvMCcCysmdE=; b=IevU6CwlYnl3xI rRGCG81v6Dh1gFFAZySB9Iw6hU4OKxp5NEefvlQNIWdsLrCC+ZMozhidR/H6XjGL/M7uSYXpLBwD4 GVlOIr3LfdcPB4cC5J0h0Mzce9f7wzKrGmBeArawW3mMn6JFxiZvSHqt9zpX92GdxklMOQ61z2bAY tvCXSjwhgNN4C5uG0UTkMwSSQ8ZUxzAiXXsVG5GYOR1QIgmz9KjIaSf89+dMfk+YQpclrSysHAdCO WrXbEASkCN3LLeOaIluDlya3vPYJ4EE0ptazMt1mFqnBAiEZJk+celDIUrnUlyt1RgvVXvw+uUTY3 QWqvTi7cpWodlAt9sCkA==; Content-Disposition: inline In-Reply-To: <10db6fa1-5b17-ebe6-09e0-6335e09e4db8@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, Nov 06, 2019 at 04:27:33PM +0000, Dmitry Safonov wrote: > Hi Peter, > > On 11/6/19 9:20 AM, Peter Zijlstra wrote: > > On Wed, Nov 06, 2019 at 03:04:51AM +0000, 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] > >> 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. > > > > I really don't understand that word salad. Why are you doing this? > > > > Sorry, I should have tried to describe better. > > I'm trying to remove external users of console_loglevel by following > reasons: I suppose since all my machines have 'debug ignore_loglevel earlyprintk=serial,ttyS0,115200 console=ttyS0,115200' I don't have this experience. > - changing console_loglevel on SMP means that unwanted messages from > other CPUs will appear (that have lower log level) > - on UMP unwanted messages may appear if the code is preempted while it > hasn't set the console_loglevel back to old > - rising console_loglevel to print wanted message(s) may not work at all > if printk() has being delayed and the console_loglevel is already set > back to old value Sure, frobbing the global console_loglevel is bad. > I also have patches in wip those needs to print backtrace with specific > loglevel (higher when it's critical, lower when it's notice and > shouldn't go to serial console). (everything always should go to serial, serial is awesome :-) > Besides on local tests I see hits those have headers (messages like > "Backtrace: ") without an actual backtrace and the reverse - a backtrace > without a reason for it. It's quite annoying and worth addressing by > syncing headers log levels to backtraces. I suppose I'm surprised there are backtraces that are not important. Either badness happened and it needs printing, or the user asked for it and it needs printing. Perhaps we should be removing backtraces if they're not important instead of allowing to print them as lower loglevels?