Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp398513ybk; Wed, 13 May 2020 03:09:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxK4KMJm834MgmLk34BwlE9LPJNHGWBgFmkde/B+jQTnahi5zSVfG7lRUxmrr74U/zHmMzT X-Received: by 2002:a17:906:6891:: with SMTP id n17mr9102826ejr.338.1589364556432; Wed, 13 May 2020 03:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589364556; cv=none; d=google.com; s=arc-20160816; b=PskVYVYVAxTqr8epWtVxLknNtLae7HLYWdeSNx3S5eDGKs55u4wtjva50scukP7EQq UxNA7aAH9Io6xacGklgCwVWHaOW4MwNfK2dxlZZYHvFki7ge6YIdzx1O4IcnBJzHf+fS s3KfuvI/hz+Dt2hXmtebEqtywQ113brIMM2Tm+ALU5jS0m4r9fo6V9NSBooU/YKGKezA W6x9A22CpQxX3yQNnvBLnfBt2AWR0lG5uJwkai7owrd9CLkhxZXlDSfnsDkzHzQNadWs /gKjPw01kbcYhnXcNCq+Fnv3H9yIzx4lMldGRoGkmuwe0DZr2mPyKeM9B0gm/tu3YDCc IPZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/bwL5LOxdTkZItOQGSq+1ga7iTHEp7LH+ljkE/Re3rE=; b=En+QH9JdBQaDpmqGTGhItAYrqWmh5dz56KVrHzH87ZLPSva/dp2OO/ZmQqHdshlbFX DOBOAdiPqpzDJ1G5M0Od5wY3JfRFdlAs5iKPOBJ/u7H8JNznPllVGGao3L4AcuRH5qTj 9Fj8Okcv1SYAfG+QEY3YMAONEjrEgEboFyNGauOF/dbTcZ3qo+/zNrq1xu2u/QjptEaV jC/P/DTHKY2IDpc+LoOlngAl+tppEMSp4nzh3pWcKCc5rcIEoqoXyKBJuxtKOzaoFpwy vdu1irwSzAb0BlbRTJp+YoRjP8ycnm5eQcy/YqlnzEMgefTWduKt663ilaLnDBDMoAB7 qBmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l20si5744933eds.589.2020.05.13.03.08.53; Wed, 13 May 2020 03:09:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388350AbgEMKEW (ORCPT + 99 others); Wed, 13 May 2020 06:04:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:53480 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733245AbgEMKET (ORCPT ); Wed, 13 May 2020 06:04:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4C8B3B1EF; Wed, 13 May 2020 10:04:19 +0000 (UTC) Date: Wed, 13 May 2020 12:04:13 +0200 From: Petr Mladek To: Tetsuo Handa Cc: Sergey Senozhatsky , Michal Hocko , Steven Rostedt , linux-kernel@vger.kernel.org, Dmitry Safonov , Yafang Shao Subject: Re: [PATCH] printk: Add loglevel for "do not print to consoles". Message-ID: <20200513100413.GH17734@linux-b0ei> References: <20200427062117.GC486@jagdpanzerIV.localdomain> <4dae86af-1d9a-f5a8-cff6-aa91ec038a79@i-love.sakura.ne.jp> <20200428121828.GP28637@dhcp22.suse.cz> <20200428154532.GU28637@dhcp22.suse.cz> <20200429142106.GG28637@dhcp22.suse.cz> <20200513062652.GM413@jagdpanzerIV.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2020-05-13 16:58:48, Tetsuo Handa wrote: > On 2020/05/13 15:26, Sergey Senozhatsky wrote: > > Yes, but this looks like it's the consumer of the messages who > > decides what to filter and what not to. rsyslog, dmesg, etc. > > will have different filtering policies. It's not like the kernel > > decides what to hide and what to show. If would compare this to > > NO_CONSOLES, then NO_CONSOLES does a different thing after all. > > I just showed an example that changing dump_tasks() messages from > KERN_INFO to KERN_DEBUG is not an option. If dump_tasks() were using > KERN_DEBUG, the consumer of the messages will have to receive all > KERN_DEBUG messages, which needlessly contains uninterested messages. > If dump_tasks() allows use of NO_CONSOLES (via e.g. sysctl switch), > the consumer does not need to receive KERN_DEBUG messages. > > What is wrong with adding NO_CONSOLES ? How does it differ from KERN_DEBUG? The debug messages: + can be disabled via sysfs + might reach console when this loglevel is enabled The console loglevel handling is already very complicated. The behavior is affected by: + four values in console_printk array: + console_loglevel + default_message_loglevel + minimum_console_loglevel + default_console_loglevel + ignore_loglevel variable + loglevel assigned to each message I really do not see a reason for another loglevel, another sysfs interface, and another special handling. It would just make it even more complicated for both developers and users. What is so special about OOM dump task so that it would deserve such complications? The dump might already be enabled or disabled. If is not important enough to reach the console then the messages should be printed with a lower loglevel. Best Regards, Petr