From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23A5EC5DF60 for ; Fri, 8 Nov 2019 16:28:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7CAA21924 for ; Fri, 8 Nov 2019 16:28:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nBmTtt8p"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=arista.com header.i=@arista.com header.b="OFQ83MN4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7CAA21924 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=arista.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org 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:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6pjLfwIjbw7wrlcoVDq1/nohfS/vbQ1x48rbigVuau0=; b=nBmTtt8pu0F5cT IRVvoJ3GupZb5OYXNq5J15vDjcIuSdX4s4Vv+ko56vL8stqwTsXxU+FJsTqz1YdluHNDpHNRvbX5I otkKNXoeFGRiK0npyxB6Y1WWoIKMm+InlPNacPhzqk6pmTMhHZtv889oYVehbF/cKOPeZlyNoCRc1 EvHxcdDZ1ub1win97f+izYc+62tPri+EyDw7/sGYL5GbDDhD+Js+DcOCC8O/kDWNihY99LiekvSRm HBFhIaQMLphMb83pbbgMb4pdLFUXz/7V6bm6ZlIJ/t0COnW9jcpryEAxXFzM724Q3Ibhy0Hsi9nVv /nTO8pdI/pMuLiXUhjFQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iT780-0005dh-72; Fri, 08 Nov 2019 16:28:52 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iT77v-0005aJ-9h for linux-riscv@lists.infradead.org; Fri, 08 Nov 2019 16:28:50 +0000 Received: by mail-lf1-x143.google.com with SMTP id f5so4939281lfp.1 for ; Fri, 08 Nov 2019 08:28:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=googlenew; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=g8y3Kv95ejyL7msYqyPIoRMuCM9aKky/CsOCvaHvzKM=; b=OFQ83MN4Hmk627ztvJPIKihtIRsS8ZJ3GNTmqGPL14tUmqtruv4K7nmTrdqjRLFkAn v66F5LmIzidO2RY0wAc8faHozHlKmYZjXqnWdur1cdgyOYMMPWxMT2qM/13lV7Gll4Nc lRCKNQhkBNihdDdl1Z0mCUKrkPWWlSTJj8W9XuLLYhohd1gFs4UlSNvhCs93ZGZd3jBA FVTjYbasessxSjfBcyeOLdW+Y8Bd7gD+BB7UCWg2KPTCWA+UwS7+l7bzP+7BahjCAYhI nOv6jmxm+6mZbCk5AkWY13lz+e0hU9EGlWVlrK7ojQr4zo4A/XJr3HfWznngkwdMz6Mb pEiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=g8y3Kv95ejyL7msYqyPIoRMuCM9aKky/CsOCvaHvzKM=; b=qhQatlpTZ7W6ynYcamhkQ9zPU7HC9YopKVOoYLVUBOPcfMNXqT2mUibZZ1oSqdO103 /rWXQ/tSa2YVG8x597yBEKdrL0PTEsTHSunE+Z8HKQaaeEBDl4pjneJD6nZpcZ2/T/7b bGhb3kR2bzRLFI23vNK+kQyHMl4rkEvGnt4kIRC2ZMyFI9PgeZxFEIy2OCycDUFzbfUR YytsFVDLEFbx2wGekyShy+P93sQ3CP7fQCAkF8w3c0mOcN8R9CEJR3PTCnOHyzAqSzeu tCAAwBfVaae1pDQxm9yLWiK7ARisbs2SVM3CUQCC9z3PSnHpTHsmwyBMJ9AWZ6D6fWIM a33w== X-Gm-Message-State: APjAAAWgdbqzVhkHufjFCq6AiyUcRZTErTgz/7Y8d5rwQO3OAgBGc+/T JlobwWefEIDaMbU+Dl6hRWE2OP/qPGQpmD/n8GL9iA== X-Google-Smtp-Source: APXvYqzHzf9qj/gQvrMhsVZj/mUBqCeBT0v/95hThrViwKN4rfJkI0AUVqq0YGCyoYWqoiClXSsdpDtSyx/K8KYU40o= X-Received: by 2002:a19:ab11:: with SMTP id u17mr7519021lfe.78.1573230521103; Fri, 08 Nov 2019 08:28:41 -0800 (PST) MIME-Version: 1.0 References: <20191106030542.868541-1-dima@arista.com> <20191106092039.GT4131@hirez.programming.kicks-ass.net> <10db6fa1-5b17-ebe6-09e0-6335e09e4db8@arista.com> <20191106203440.GH3079@worktop.programming.kicks-ass.net> In-Reply-To: <20191106203440.GH3079@worktop.programming.kicks-ass.net> From: Dmitry Safonov Date: Fri, 8 Nov 2019 16:28:30 +0000 Message-ID: Subject: Re: [PATCH 00/50] Add log level to show_stack() To: Peter Zijlstra X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191108_082847_334865_F0BE37C4 X-CRM114-Status: GOOD ( 20.30 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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" , LKML , Ralf Baechle , Paul Mackerras , Andrew Morton , linux-ia64@vger.kernel.org, Tetsuo Handa , James Hogan , "James E.J. Bottomley" , Max Filippov , Vincent Chen , Ingo Molnar , linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , linux-hexagon@vger.kernel.org, Helge Deller , "open list:TENSILICA XTENSA PORT \(xtensa\)" , Vasily Gorbik , Aurelien Jacquiot , linux-m68k@lists.linux-m68k.org, Stafford Horne , linux-arm-kernel@lists.infradead.org, Chris Zankel , Tony Luck , Douglas Anderson , Benjamin Herrenschmidt , Dmitry Safonov <0x7f454c46@gmail.com>, Will Deacon , Daniel Thompson , Brian Cain , Christian Borntraeger , kgdb-bugreport@lists.sourceforge.net, linux-snps-arc@lists.infradead.org, Fenghua Yu , Borislav Petkov , Jeff Dike , Steven Rostedt , Ivan Kokshaysky , Greentime Hu , Guan Xuetao , linux-parisc@vger.kernel.org, linux-alpha@vger.kernel.org, Ley Foon Tan , "David S. Miller" , Rich Felker , Petr Mladek , "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Anton Ivanov , Jonas Bonn , Richard Weinberger , X86 ML , Russell King , clang-built-linux@googlegroups.com, Ingo Molnar , Mark Salter , Albert Ou , Stefan Kristiansson , openrisc@lists.librecores.org, Paul Walmsley , Michal Simek , Vineet Gupta , linux-mips@vger.kernel.org, Sergey Senozhatsky , Palmer Dabbelt , Jason Wessel , nios2-dev@lists.rocketboards.org, linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org On 11/6/19 8:34 PM, Peter Zijlstra wrote: > On Wed, Nov 06, 2019 at 04:27:33PM +0000, Dmitry Safonov wrote: [..] >> 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. Yeah, I remember you avoid all those functionalities of printk(), fair enough. On the other side, regular users and I'm betting most of the non-tuned distributions use /proc/sys/kernel/printk by default. (Checking on my Arch & Fedora - loglevel 4 from the box) >> - 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 :-) Personally I agree. Unfortunately, here @Arista there are switches (I'm speaking about the order of thousands at least) those have baud-rate 9600. It's a bit expensive being elaborate with such setup. >> 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? Well, the use-case for lower log-level is that everything goes into logs (/var/log/dmesg or /var/log/messages whatever rsyslog has settting). That has it's value: - after a failure (i.e. panic) messages, those were only signs that something goes wrong can be seen in logs which can give ideas what has happened. - before the failure, those messages go to telemetry and can be auto-magically processed remotely to take a decision (e.g. balance the traffic away). I wish all the information could be gathered in the userspace, but many existing kernel/driver messages are valuable. A more detailed example is hung task detector: we want to have the backtrace for a task that is in uninterruptible state too long, but only in logs as printing on serial console may lead to holding console lock and watchdog. Besides customer notifications and investigations, I see the value of such "bottleneck" warnings during long-running integration tests. Thanks, Dmitry _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93D3CC17440 for ; Sat, 9 Nov 2019 01:23:43 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D85F21019 for ; Sat, 9 Nov 2019 01:23:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=arista.com header.i=@arista.com header.b="OFQ83MN4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D85F21019 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=arista.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 478ztP0C8KzF60D for ; Sat, 9 Nov 2019 12:23:41 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=arista.com (client-ip=2a00:1450:4864:20::142; helo=mail-lf1-x142.google.com; envelope-from=dima@arista.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=arista.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=arista.com header.i=@arista.com header.b="OFQ83MN4"; dkim-atps=neutral Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 478m1B5cPRzDrG2 for ; Sat, 9 Nov 2019 03:28:45 +1100 (AEDT) Received: by mail-lf1-x142.google.com with SMTP id f4so4919316lfk.7 for ; Fri, 08 Nov 2019 08:28:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=googlenew; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=g8y3Kv95ejyL7msYqyPIoRMuCM9aKky/CsOCvaHvzKM=; b=OFQ83MN4Hmk627ztvJPIKihtIRsS8ZJ3GNTmqGPL14tUmqtruv4K7nmTrdqjRLFkAn v66F5LmIzidO2RY0wAc8faHozHlKmYZjXqnWdur1cdgyOYMMPWxMT2qM/13lV7Gll4Nc lRCKNQhkBNihdDdl1Z0mCUKrkPWWlSTJj8W9XuLLYhohd1gFs4UlSNvhCs93ZGZd3jBA FVTjYbasessxSjfBcyeOLdW+Y8Bd7gD+BB7UCWg2KPTCWA+UwS7+l7bzP+7BahjCAYhI nOv6jmxm+6mZbCk5AkWY13lz+e0hU9EGlWVlrK7ojQr4zo4A/XJr3HfWznngkwdMz6Mb pEiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=g8y3Kv95ejyL7msYqyPIoRMuCM9aKky/CsOCvaHvzKM=; b=W3UyHT0Jf5Jxl9LVi/4SJmsrlReIvGfU1aIwpvKMDziGwNr17wmfPOGJD4OsyBO3kW Ns/tWqxLwz5dQLgnPm0si6Wfu2r6wD8tWU76Gft42Q71tsLydkR8NGspZ9Y1VjWSi91G 1tCwg8bQKENrREhOMMUoGGTRtnwgaj3/RizgxvYib4GQQbrj5DoxyZnPIYBIIIALXxFq N5IGZPJTGtxSJTvKKaUjahM9soz6JOwk6A4kM5DjyhhRkHok46xKvNhbKq5edo0+GRBW c95ICKWFdE0AEmuliOGjZwfZUBrPGLTR82oVYzdEo9qb/JigfEOK70f57T4ERj9cnhhV lMOg== X-Gm-Message-State: APjAAAWftJ/HGob/8rmg/ugn4mNh8og0HuWqNVM9Z4l/KwyP1v26oixf 8cNHwwNymbxJewwiB3vG50bSqm6cg1JoTS1sG+AKNw== X-Google-Smtp-Source: APXvYqzHzf9qj/gQvrMhsVZj/mUBqCeBT0v/95hThrViwKN4rfJkI0AUVqq0YGCyoYWqoiClXSsdpDtSyx/K8KYU40o= X-Received: by 2002:a19:ab11:: with SMTP id u17mr7519021lfe.78.1573230521103; Fri, 08 Nov 2019 08:28:41 -0800 (PST) MIME-Version: 1.0 References: <20191106030542.868541-1-dima@arista.com> <20191106092039.GT4131@hirez.programming.kicks-ass.net> <10db6fa1-5b17-ebe6-09e0-6335e09e4db8@arista.com> <20191106203440.GH3079@worktop.programming.kicks-ass.net> In-Reply-To: <20191106203440.GH3079@worktop.programming.kicks-ass.net> From: Dmitry Safonov Date: Fri, 8 Nov 2019 16:28:30 +0000 Message-ID: Subject: Re: [PATCH 00/50] Add log level to show_stack() To: Peter Zijlstra Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Sat, 09 Nov 2019 12:19:43 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juri Lelli , linux-sh@vger.kernel.org, Catalin Marinas , Ben Segall , Guo Ren , Pavel Machek , Vincent Guittot , Paul Burton , 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" , LKML , Ralf Baechle , Paul Mackerras , Andrew Morton , linux-ia64@vger.kernel.org, Tetsuo Handa , James Hogan , "James E.J. Bottomley" , Max Filippov , Vincent Chen , Ingo Molnar , linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , linux-hexagon@vger.kernel.org, Helge Deller , "open list:TENSILICA XTENSA PORT \(xtensa\)" , Vasily Gorbik , Aurelien Jacquiot , linux-m68k@lists.linux-m68k.org, Stafford Horne , linux-arm-kernel@lists.infradead.org, Chris Zankel , Tony Luck , Douglas Anderson , Dmitry Safonov <0x7f454c46@gmail.com>, Will Deacon , Daniel Thompson , Brian Cain , Christian Borntraeger , kgdb-bugreport@lists.sourceforge.net, linux-snps-arc@lists.infradead.org, Fenghua Yu , Borislav Petkov , Jeff Dike , Steven Rostedt , Ivan Kokshaysky , Greentime Hu , Guan Xuetao , linux-parisc@vger.kernel.org, linux-alpha@vger.kernel.org, Ley Foon Tan , "David S. Miller" , Rich Felker , Petr Mladek , "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Anton Ivanov , Jonas Bonn , Richard Weinberger , X86 ML , Russell King , clang-built-linux@googlegroups.com, Ingo Molnar , Mark Salter , Albert Ou , Stefan Kristiansson , openrisc@lists.librecores.org, Paul Walmsley , Michal Simek , Vineet Gupta , linux-mips@vger.kernel.org, Sergey Senozhatsky , Palmer Dabbelt , Jason Wessel , nios2-dev@lists.rocketboards.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 11/6/19 8:34 PM, Peter Zijlstra wrote: > On Wed, Nov 06, 2019 at 04:27:33PM +0000, Dmitry Safonov wrote: [..] >> 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. Yeah, I remember you avoid all those functionalities of printk(), fair enough. On the other side, regular users and I'm betting most of the non-tuned distributions use /proc/sys/kernel/printk by default. (Checking on my Arch & Fedora - loglevel 4 from the box) >> - 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 :-) Personally I agree. Unfortunately, here @Arista there are switches (I'm speaking about the order of thousands at least) those have baud-rate 9600. It's a bit expensive being elaborate with such setup. >> 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? Well, the use-case for lower log-level is that everything goes into logs (/var/log/dmesg or /var/log/messages whatever rsyslog has settting). That has it's value: - after a failure (i.e. panic) messages, those were only signs that something goes wrong can be seen in logs which can give ideas what has happened. - before the failure, those messages go to telemetry and can be auto-magically processed remotely to take a decision (e.g. balance the traffic away). I wish all the information could be gathered in the userspace, but many existing kernel/driver messages are valuable. A more detailed example is hung task detector: we want to have the backtrace for a task that is in uninterruptible state too long, but only in logs as printing on serial console may lead to holding console lock and watchdog. Besides customer notifications and investigations, I see the value of such "bottleneck" warnings during long-running integration tests. Thanks, Dmitry From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B51D8FA372C for ; Fri, 8 Nov 2019 16:28:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8357A21D7E for ; Fri, 8 Nov 2019 16:28:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GOo2zr59"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=arista.com header.i=@arista.com header.b="OFQ83MN4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8357A21D7E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=arista.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org 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:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7Oi0URCVlCW/xv6mf3y82Ao9G3AOxjSzoaGA9O2Wao8=; b=GOo2zr59AZ6Tob ByEndOWOFE/L4Xu4NBHrHlE0ElV+1Izi43qDMD4WWRT9xhf2hNFSGWwPma1BZa77QWi8p1EbMryWF kyq4PNHL+kVrHMhGpy4nkWKlgB5cOtZXVqVcEW7YVXd06pndH8yZx7qzqrzs5RS+Qf1AWkf9PhNyQ Z3DMMuOIDEF8mX25Vo8Inkb6cucZplq64JQ3J/NYAqmVufIAmD1Y/oCwmC7a9nDS3VMR2mBNcl4Nj dqWloNynH9PLRjzvhukwV06wu+0YFHnr1dTFSBh4d+1wEupoJwZWE0I0hRxyKXd3f3es7Lm2u0Cm3 YI/Qk3d14560/WxfCyCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iT77z-0005dW-Sf; Fri, 08 Nov 2019 16:28:51 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iT77v-0005aH-95 for linux-snps-arc@lists.infradead.org; Fri, 08 Nov 2019 16:28:50 +0000 Received: by mail-lf1-x144.google.com with SMTP id o65so1238272lff.13 for ; Fri, 08 Nov 2019 08:28:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=googlenew; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=g8y3Kv95ejyL7msYqyPIoRMuCM9aKky/CsOCvaHvzKM=; b=OFQ83MN4Hmk627ztvJPIKihtIRsS8ZJ3GNTmqGPL14tUmqtruv4K7nmTrdqjRLFkAn v66F5LmIzidO2RY0wAc8faHozHlKmYZjXqnWdur1cdgyOYMMPWxMT2qM/13lV7Gll4Nc lRCKNQhkBNihdDdl1Z0mCUKrkPWWlSTJj8W9XuLLYhohd1gFs4UlSNvhCs93ZGZd3jBA FVTjYbasessxSjfBcyeOLdW+Y8Bd7gD+BB7UCWg2KPTCWA+UwS7+l7bzP+7BahjCAYhI nOv6jmxm+6mZbCk5AkWY13lz+e0hU9EGlWVlrK7ojQr4zo4A/XJr3HfWznngkwdMz6Mb pEiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=g8y3Kv95ejyL7msYqyPIoRMuCM9aKky/CsOCvaHvzKM=; b=t/uHGOI3Vx5MhKgXLm5YvozDT+LJvOkEFf0sq0K4q/LhK1zQqSAEw0tCPpLklFwDsa YT5enALfKmTyLqVspUAsNCyXZd5EWb2DrmuosHKGOB94R/5bzea/P+3pmxP1iLyTS59J IddVOn9cuE9w64VES2JzLESdxAjWAM8LSZB+Bc9qYWEASVGjErBzR2V8+BZDgce3SlRo mxJ8MAmL+BxcLturVAHmBrKmvW0UP2T6DzYnZ06VIYeBqd6CFJhQW+d0Ah7rFW5GNj1J KdmULROVgJeEYprsh0wZITO8bWiKPmmonzdy0WI8ppTrJivNGWZN3Cnon4cqYeG6NWUT DP5w== X-Gm-Message-State: APjAAAWOrIYAEeaAJra5c8UKVm0TsdBYN1rlhWwo1fvr4TvjMSL9Y8Eq m7xpf3UYx97dwA4J0SXi3AjDOWJmNziXj4/3IVeVhQ== X-Google-Smtp-Source: APXvYqzHzf9qj/gQvrMhsVZj/mUBqCeBT0v/95hThrViwKN4rfJkI0AUVqq0YGCyoYWqoiClXSsdpDtSyx/K8KYU40o= X-Received: by 2002:a19:ab11:: with SMTP id u17mr7519021lfe.78.1573230521103; Fri, 08 Nov 2019 08:28:41 -0800 (PST) MIME-Version: 1.0 References: <20191106030542.868541-1-dima@arista.com> <20191106092039.GT4131@hirez.programming.kicks-ass.net> <10db6fa1-5b17-ebe6-09e0-6335e09e4db8@arista.com> <20191106203440.GH3079@worktop.programming.kicks-ass.net> In-Reply-To: <20191106203440.GH3079@worktop.programming.kicks-ass.net> From: Dmitry Safonov Date: Fri, 8 Nov 2019 16:28:30 +0000 Message-ID: Subject: Re: [PATCH 00/50] Add log level to show_stack() To: Peter Zijlstra X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191108_082847_318330_E79B9CA0 X-CRM114-Status: GOOD ( 20.30 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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" , LKML , Ralf Baechle , Paul Mackerras , Andrew Morton , linux-ia64@vger.kernel.org, Tetsuo Handa , James Hogan , "James E.J. Bottomley" , Max Filippov , Vincent Chen , Ingo Molnar , linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , linux-hexagon@vger.kernel.org, Helge Deller , "open list:TENSILICA XTENSA PORT \(xtensa\)" , Vasily Gorbik , Aurelien Jacquiot , linux-m68k@lists.linux-m68k.org, Stafford Horne , linux-arm-kernel@lists.infradead.org, Chris Zankel , Tony Luck , Douglas Anderson , Benjamin Herrenschmidt , Dmitry Safonov <0x7f454c46@gmail.com>, Will Deacon , Daniel Thompson , Brian Cain , Christian Borntraeger , kgdb-bugreport@lists.sourceforge.net, linux-snps-arc@lists.infradead.org, Fenghua Yu , Borislav Petkov , Jeff Dike , Steven Rostedt , Ivan Kokshaysky , Greentime Hu , Guan Xuetao , linux-parisc@vger.kernel.org, linux-alpha@vger.kernel.org, Ley Foon Tan , "David S. Miller" , Rich Felker , Petr Mladek , "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Anton Ivanov , Jonas Bonn , Richard Weinberger , X86 ML , Russell King , clang-built-linux@googlegroups.com, Ingo Molnar , Mark Salter , Albert Ou , Stefan Kristiansson , openrisc@lists.librecores.org, Paul Walmsley , Michal Simek , Vineet Gupta , linux-mips@vger.kernel.org, Sergey Senozhatsky , Palmer Dabbelt , Jason Wessel , nios2-dev@lists.rocketboards.org, linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org On 11/6/19 8:34 PM, Peter Zijlstra wrote: > On Wed, Nov 06, 2019 at 04:27:33PM +0000, Dmitry Safonov wrote: [..] >> 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. Yeah, I remember you avoid all those functionalities of printk(), fair enough. On the other side, regular users and I'm betting most of the non-tuned distributions use /proc/sys/kernel/printk by default. (Checking on my Arch & Fedora - loglevel 4 from the box) >> - 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 :-) Personally I agree. Unfortunately, here @Arista there are switches (I'm speaking about the order of thousands at least) those have baud-rate 9600. It's a bit expensive being elaborate with such setup. >> 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? Well, the use-case for lower log-level is that everything goes into logs (/var/log/dmesg or /var/log/messages whatever rsyslog has settting). That has it's value: - after a failure (i.e. panic) messages, those were only signs that something goes wrong can be seen in logs which can give ideas what has happened. - before the failure, those messages go to telemetry and can be auto-magically processed remotely to take a decision (e.g. balance the traffic away). I wish all the information could be gathered in the userspace, but many existing kernel/driver messages are valuable. A more detailed example is hung task detector: we want to have the backtrace for a task that is in uninterruptible state too long, but only in logs as printing on serial console may lead to holding console lock and watchdog. Besides customer notifications and investigations, I see the value of such "bottleneck" warnings during long-running integration tests. Thanks, Dmitry _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Safonov Date: Fri, 8 Nov 2019 16:28:30 +0000 Subject: [OpenRISC] [PATCH 00/50] Add log level to show_stack() In-Reply-To: <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> <20191106203440.GH3079@worktop.programming.kicks-ass.net> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org On 11/6/19 8:34 PM, Peter Zijlstra wrote: > On Wed, Nov 06, 2019 at 04:27:33PM +0000, Dmitry Safonov wrote: [..] >> 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. Yeah, I remember you avoid all those functionalities of printk(), fair enough. On the other side, regular users and I'm betting most of the non-tuned distributions use /proc/sys/kernel/printk by default. (Checking on my Arch & Fedora - loglevel 4 from the box) >> - 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 :-) Personally I agree. Unfortunately, here @Arista there are switches (I'm speaking about the order of thousands at least) those have baud-rate 9600. It's a bit expensive being elaborate with such setup. >> 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? Well, the use-case for lower log-level is that everything goes into logs (/var/log/dmesg or /var/log/messages whatever rsyslog has settting). That has it's value: - after a failure (i.e. panic) messages, those were only signs that something goes wrong can be seen in logs which can give ideas what has happened. - before the failure, those messages go to telemetry and can be auto-magically processed remotely to take a decision (e.g. balance the traffic away). I wish all the information could be gathered in the userspace, but many existing kernel/driver messages are valuable. A more detailed example is hung task detector: we want to have the backtrace for a task that is in uninterruptible state too long, but only in logs as printing on serial console may lead to holding console lock and watchdog. Besides customer notifications and investigations, I see the value of such "bottleneck" warnings during long-running integration tests. Thanks, Dmitry From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 References: <20191106030542.868541-1-dima@arista.com> <20191106092039.GT4131@hirez.programming.kicks-ass.net> <10db6fa1-5b17-ebe6-09e0-6335e09e4db8@arista.com> <20191106203440.GH3079@worktop.programming.kicks-ass.net> In-Reply-To: <20191106203440.GH3079@worktop.programming.kicks-ass.net> From: Dmitry Safonov Date: Fri, 8 Nov 2019 16:28:30 +0000 Message-ID: Subject: Re: [PATCH 00/50] Add log level to show_stack() Content-Type: text/plain; charset="UTF-8" To: Peter Zijlstra Cc: LKML , Dmitry Safonov <0x7f454c46@gmail.com>, Andrew Morton , Greg Kroah-Hartman , Ingo Molnar , Jiri Slaby , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Tetsuo Handa , Albert Ou , Ben Segall , Dietmar Eggemann , Greentime Hu , Ingo Molnar , James Hogan , Juri Lelli , Mel Gorman , Michal Simek , Palmer Dabbelt , Paul Burton , Paul Walmsley , Ralf Baechle , Thomas Gleixner , Vincent Chen , Vincent Guittot , Will Deacon , linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, Ivan Kokshaysky , Matt Turner , Richard Henderson , linux-alpha@vger.kernel.org, Vineet Gupta , linux-snps-arc@lists.infradead.org, Russell King , linux-arm-kernel@lists.infradead.org, clang-built-linux@googlegroups.com, Catalin Marinas , Aurelien Jacquiot , Mark Salter , linux-c6x-dev@linux-c6x.org, Guo Ren , Yoshinori Sato , uclinux-h8-devel@lists.sourceforge.jp, Brian Cain , linux-hexagon@vger.kernel.org, Fenghua Yu , Tony Luck , linux-ia64@vger.kernel.org, Geert Uytterhoeven , linux-m68k@lists.linux-m68k.org, Ley Foon Tan , nios2-dev@lists.rocketboards.org, Jonas Bonn , Stafford Horne , Stefan Kristiansson , openrisc@lists.librecores.org, Helge Deller , "James E.J. Bottomley" , linux-parisc@vger.kernel.org, Benjamin Herrenschmidt , Michael Ellerman , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, Christian Borntraeger , Heiko Carstens , Vasily Gorbik , linux-s390@vger.kernel.org, Rich Felker , linux-sh@vger.kernel.org, "David S. Miller" , sparclinux@vger.kernel.org, Anton Ivanov , Jeff Dike , Richard Weinberger , linux-um@lists.infradead.org, Guan Xuetao , Borislav Petkov , "H. Peter Anvin" , X86 ML , Chris Zankel , Max Filippov , "open list:TENSILICA XTENSA PORT (xtensa)" , Len Brown , Pavel Machek , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Daniel Thompson , Douglas Anderson , Jason Wessel , kgdb-bugreport@lists.sourceforge.net List-ID: On 11/6/19 8:34 PM, Peter Zijlstra wrote: > On Wed, Nov 06, 2019 at 04:27:33PM +0000, Dmitry Safonov wrote: [..] >> 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. Yeah, I remember you avoid all those functionalities of printk(), fair enough. On the other side, regular users and I'm betting most of the non-tuned distributions use /proc/sys/kernel/printk by default. (Checking on my Arch & Fedora - loglevel 4 from the box) >> - 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 :-) Personally I agree. Unfortunately, here @Arista there are switches (I'm speaking about the order of thousands at least) those have baud-rate 9600. It's a bit expensive being elaborate with such setup. >> 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? Well, the use-case for lower log-level is that everything goes into logs (/var/log/dmesg or /var/log/messages whatever rsyslog has settting). That has it's value: - after a failure (i.e. panic) messages, those were only signs that something goes wrong can be seen in logs which can give ideas what has happened. - before the failure, those messages go to telemetry and can be auto-magically processed remotely to take a decision (e.g. balance the traffic away). I wish all the information could be gathered in the userspace, but many existing kernel/driver messages are valuable. A more detailed example is hung task detector: we want to have the backtrace for a task that is in uninterruptible state too long, but only in logs as printing on serial console may lead to holding console lock and watchdog. Besides customer notifications and investigations, I see the value of such "bottleneck" warnings during long-running integration tests. Thanks, Dmitry From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Safonov Subject: Re: [PATCH 00/50] Add log level to show_stack() Date: Fri, 8 Nov 2019 16:28:30 +0000 Message-ID: References: <20191106030542.868541-1-dima@arista.com> <20191106092039.GT4131@hirez.programming.kicks-ass.net> <10db6fa1-5b17-ebe6-09e0-6335e09e4db8@arista.com> <20191106203440.GH3079@worktop.programming.kicks-ass.net> 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:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7Oi0URCVlCW/xv6mf3y82Ao9G3AOxjSzoaGA9O2Wao8=; b=GOo2zr59AZ6Tob ByEndOWOFE/L4Xu4NBHrHlE0ElV+1Izi43qDMD4WWRT9xhf2hNFSGWwPma1BZa77QWi8p1EbMryWF kyq4PNHL+kVrHMhGpy4nkWKlgB5cOtZXVqVcEW7YVXd06pndH8yZx7qzqrzs5RS+Qf1AWkf9PhNyQ Z3DMMuOIDEF8mX25Vo8Inkb6cucZplq64JQ3J/NYAqmVufIAmD1Y/oCwmC7a9nDS3VMR2mBNcl4Nj dqWloNynH9PLRjzvhukwV06wu+0YFHnr1dTFSBh4d+1wEupoJwZWE0I0hRxyKXd3f3es7Lm2u0Cm3 YI/Qk3d14560/WxfCyCg==; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=googlenew; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=g8y3Kv95ejyL7msYqyPIoRMuCM9aKky/CsOCvaHvzKM=; b=OFQ83MN4Hmk627ztvJPIKihtIRsS8ZJ3GNTmqGPL14tUmqtruv4K7nmTrdqjRLFkAn v66F5LmIzidO2RY0wAc8faHozHlKmYZjXqnWdur1cdgyOYMMPWxMT2qM/13lV7Gll4Nc lRCKNQhkBNihdDdl1Z0mCUKrkPWWlSTJj8W9XuLLYhohd1gFs4UlSNvhCs93ZGZd3jBA FVTjYbasessxSjfBcyeOLdW+Y8Bd7gD+BB7UCWg2KPTCWA+UwS7+l7bzP+7BahjCAYhI nOv6jmxm+6mZbCk5AkWY13lz+e0hU9EGlWVlrK7ojQr4zo4A/XJr3HfWznngkwdMz6Mb pEiA== In-Reply-To: <20191106203440.GH3079@worktop.programming.kicks-ass.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+gla-linux-snps-arc=m.gmane.org@lists.infradead.org To: Peter Zijlstra 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" , LKML , Ralf On 11/6/19 8:34 PM, Peter Zijlstra wrote: > On Wed, Nov 06, 2019 at 04:27:33PM +0000, Dmitry Safonov wrote: [..] >> 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. Yeah, I remember you avoid all those functionalities of printk(), fair enough. On the other side, regular users and I'm betting most of the non-tuned distributions use /proc/sys/kernel/printk by default. (Checking on my Arch & Fedora - loglevel 4 from the box) >> - 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 :-) Personally I agree. Unfortunately, here @Arista there are switches (I'm speaking about the order of thousands at least) those have baud-rate 9600. It's a bit expensive being elaborate with such setup. >> 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? Well, the use-case for lower log-level is that everything goes into logs (/var/log/dmesg or /var/log/messages whatever rsyslog has settting). That has it's value: - after a failure (i.e. panic) messages, those were only signs that something goes wrong can be seen in logs which can give ideas what has happened. - before the failure, those messages go to telemetry and can be auto-magically processed remotely to take a decision (e.g. balance the traffic away). I wish all the information could be gathered in the userspace, but many existing kernel/driver messages are valuable. A more detailed example is hung task detector: we want to have the backtrace for a task that is in uninterruptible state too long, but only in logs as printing on serial console may lead to holding console lock and watchdog. Besides customer notifications and investigations, I see the value of such "bottleneck" warnings during long-running integration tests. Thanks, Dmitry