Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp804630ybz; Wed, 29 Apr 2020 09:40:19 -0700 (PDT) X-Google-Smtp-Source: APiQypKx0YAas9VyrNpGP7S7IcDs6w3CVmLSWtHiqR0xOzKBfzuhnwNjUSXzpaUzyqhIQmfT/J1Q X-Received: by 2002:a17:906:ca49:: with SMTP id jx9mr3389558ejb.246.1588178419109; Wed, 29 Apr 2020 09:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588178419; cv=none; d=google.com; s=arc-20160816; b=JCMf6cF4/i1DCVlIwC+deD8TDTT0PpBpoZ/W7TbV3JGM/XTGy5v7KZR9XGbFOLLOg9 4Cg8QhpmuLi0+qwQbkaAA1LTUIQewKD+iYxlo5uAzwcsbJiHp1gYyDJx6rquKMeWtg54 RBLxvO52ZzmHQDAYXxcYkjke2Xv48hSvn3NFixqcitbweZsZ+x+NtVPU8w91jKHrRtAn 2fr44ryvrwp76s1fI88oGtzYPhFNKpL9iyZTeIEsFQ62aeAtq5X374fyaw4u/jAly4hc 8LCV2wY62+6WE7tbdkkp20CdojtZ25t+QLqFzRG/ECW+LB03phs8DX+J5t2s25QoxpQ/ uKHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=5is5Qhyq3vY/U/JZHuwD6GAfJY7cLS6d29EsXjDCbSc=; b=J2+ZFB2VT/6g9PFZrA0oxrl36P2n9cBUpyJs8m6SyGKnSno1k9Te1pAhDdvfszePYy E1UQE1wwFp/JHkqI2/KIBX18Ph+Vg2j2enCSOQouXgUjgP2LYInHl5v7EXG47SEgXtB6 kd1fXTHjn1iXdBlQTdazUDXY2PwHzvTCXWN6CdOaDw4xYN30zOiBYiqb+mX28k8Hseog P24XLCNDpDbBDouFba+WaJ8rkWwbPKpwP8o/zrsQ2//5EAAxJtfGZbUuEqr31m16FuhZ b7tlYRm8kOWqjFnh61F9FPQAySB9e0X5sP9g+xEoHKbV40FAi5ueLsKU+q4TSDD0t2X4 8WQg== 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 j1si4240173ejg.178.2020.04.29.09.39.53; Wed, 29 Apr 2020 09:40:19 -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 S1726814AbgD2Qfz (ORCPT + 99 others); Wed, 29 Apr 2020 12:35:55 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:58137 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726524AbgD2Qfy (ORCPT ); Wed, 29 Apr 2020 12:35:54 -0400 Received: from fsav106.sakura.ne.jp (fsav106.sakura.ne.jp [27.133.134.233]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 03TGZEqk053301; Thu, 30 Apr 2020 01:35:14 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav106.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav106.sakura.ne.jp); Thu, 30 Apr 2020 01:35:14 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav106.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 03TGZ70P053248 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 30 Apr 2020 01:35:14 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH] printk: Add loglevel for "do not print to consoles". To: Michal Hocko Cc: Sergey Senozhatsky , Petr Mladek , Steven Rostedt , linux-kernel@vger.kernel.org, Dmitry Safonov , Yafang Shao References: <20200424024239.63607-1-penguin-kernel@I-love.SAKURA.ne.jp> <20200425004609.GE8982@jagdpanzerIV.localdomain> <842ff40b-a232-6098-4333-996a3033b30a@i-love.sakura.ne.jp> <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> From: Tetsuo Handa Message-ID: Date: Thu, 30 Apr 2020 01:35:04 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200429142106.GG28637@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/04/29 23:21, Michal Hocko wrote: > I am trying to say that KERN_NO_CONSOLES resembles more a policy than a > priority. Because I as a developer have no idea whether the message is > good enough for console or not. Right, KERN_NO_CONSOLES is not a priority. > I believe we are free to change kernel log levels as we find a fit. I > was not aware that KERN_DEBUG messages are automatically filtered out. Below is the default rules for rsyslog-8.24.0-52.el7 (userspace syslog daemon). Of course administrators can modify as needed, but notice that KERN_INFO is saved to /var/log/messages but KERN_DEBUG is saved to nowhere. ---------- # Log all kernel messages to the console. # Logging much else clutters up the screen. #kern.* /dev/console # Log anything (except mail) of level info or higher. # Don't log private authentication messages! *.info;mail.none;authpriv.none;cron.none /var/log/messages # The authpriv file has restricted access. authpriv.* /var/log/secure # Log all the mail messages in one place. mail.* -/var/log/maillog # Log cron stuff cron.* /var/log/cron # Everybody gets emergency messages *.emerg :omusrmsg:* # Save news errors of level crit and higher in a special file. uucp,news.crit /var/log/spooler # Save boot messages also to boot.log local7.* /var/log/boot.log ---------- > Even if this is the case then this doesn't really disallow admins to > allow KERN_DEBUG into log files. Dump of the oom eligible tasks is > arguably a debugging output anyway. So I disagree with your statement. If dump_tasks() were changed to use KERN_DEBUG, administrators have to add "kern.debug" rule (at the same time endure a lot of noise from KERN_DEBUG) in order to record OOM victim candidates for later analysis. > >> If the kernel allows the former to use KERN_NO_CONSOLES in addition to KERN_INFO, the administrator can >> select from two choices: printing "both the former and the latter" or "only the latter" to consoles. > > I am not really familiar with all the possibilities admins have when > setting filtering for different consoles but KERN_NO_CONSOLES sounds > rather alien to the existing priority based approach. KERN_NO_CONSOLES is not a priority based approach. KERN_NO_CONSOLES resembles CONSOLE_LOGLEVEL_SILENT. > You can fine tune > priorities and that is all right because they should be reflecting > importance. Developer's importance and administrator's interests are different. Any printk() user is randomly selecting KERN_$LEVEL. Administrators are swayed by having to record the lowest priority from all interested messages. > But global no-consoles doesn't really fit in here because > each console might require a different policy but the marking is > unconditional and largely unaware of existing consoles. Why unconditional? I'm saying that users of KERN_NO_CONSOLES marking (in other words, "whether the message is good enough for console or not") should be configurable via e.g. sysctl. If administrators want to use per-console loglevel setting, they can tell the kernel not to mark KERN_NO_CONSOLES via e.g. sysctl.