Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp446151ybk; Wed, 13 May 2020 04:24:54 -0700 (PDT) X-Google-Smtp-Source: APiQypK2QxKLgitVUIrCvpKvi/ruJD0e3tdy44+1d+WAj56hJkCWO/X4XuSdb4mXRvHie5ojQt8/ X-Received: by 2002:aa7:d606:: with SMTP id c6mr22197900edr.107.1589369093997; Wed, 13 May 2020 04:24:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589369093; cv=none; d=google.com; s=arc-20160816; b=SEDq3BYWZNX86/4U3ioRZV3CyzDKbBV/xg19xtU6QRvTGYjoJKWT4n1CzfCpUA9/8e ZKSje2fICP1+RbzAW2Crtx4lGhxD9jqhuASOkysb4AxDPjmYRrbFGP5f/ab/+CAWItNW 8d+KRFf3KD6E6anl5rIydXUNzvy8LDP/B4gyb915y7pK5+338yz6kW3yRpigwvEMgbsF P9fcxD1zP1Fjz0h1dyAYeeRfoBBt6Rly4sfygWVmNhoQW9u5rTsMuYKfC8RIxkv+wTFQ CkNW610HEsAuJKGrivKPzPv5LTBEFCfHB8PTr4i1QonJrQx/fJzQd9ouuz2RYNQQuxL5 MXGA== 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=q8Wt3VqoeGpnnY6SBJ8uHyGagiYl7gcgXTC3hzNSa1Q=; b=p75SL6Rkq+sBlC3Lr/KehqlieKg8N35qLCYWTN3f8NQDlDoSkHOP/l0I0oMks0lKca ypiu5q6/24PrgZ1xedZ7lpSgpA+yO7oVeHzCLdpSAUzKNHdDGTHxiXNEh0eXIN/QBdWy Q4YpwA7fzNcGkfoG8f6WRHX7NIKYogPU26TrwypWzLF95MQuxVlzVp/mCVB+BSjLfvDt 96kg1KM/LrMQImXUPoW1/bXVYmjLBBLJXsApvWGIuoJuEkWgshVJ9xxUzFFcpjzDay9d oty1xAGxzUSwY27YElqyh8ZzC850AhlvFQ6KW5To9l1d/PmjzqvqhhQ/VvGnmvZ4796O gMlw== 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 d9si8800491ejh.303.2020.05.13.04.24.30; Wed, 13 May 2020 04:24:53 -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 S1732628AbgEMLEe (ORCPT + 99 others); Wed, 13 May 2020 07:04:34 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:57397 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728784AbgEMLEd (ORCPT ); Wed, 13 May 2020 07:04:33 -0400 Received: from fsav108.sakura.ne.jp (fsav108.sakura.ne.jp [27.133.134.235]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 04DB3rMs016231; Wed, 13 May 2020 20:03:53 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav108.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav108.sakura.ne.jp); Wed, 13 May 2020 20:03:53 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav108.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 04DB3qtu016227 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 May 2020 20:03:53 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH] printk: Add loglevel for "do not print to consoles". To: Petr Mladek Cc: Sergey Senozhatsky , Michal Hocko , Steven Rostedt , linux-kernel@vger.kernel.org, Dmitry Safonov , Yafang Shao 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> <20200513100413.GH17734@linux-b0ei> From: Tetsuo Handa Message-ID: <20564555-7b84-f716-5dcd-978f76ad459a@i-love.sakura.ne.jp> Date: Wed, 13 May 2020 20:03:53 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200513100413.GH17734@linux-b0ei> 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/05/13 19:04, Petr Mladek wrote: >> 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 KERN_NO_CONSOLES is different from KERN_DEBUG in that KERN_NO_CONSOLES itself does not affect userspace daemon's judgement (whether to filter KERN_$LOGLEVEL messages). > What is so special about OOM dump task so that it would deserve such > complications? OOM dump task is special in that it can generate thousands of KERN_INFO messages. If such messages are printed to consoles, it defers solving OOM situation. But setting /proc/sys/vm/oom_dump_tasks to 0 causes such messages being not delivered to userspace daemon for later analysis. Therefore, we can not set /proc/sys/vm/oom_dump_tasks to 0 if we want to save such messages for later analysis. Changing console loglevel (e.g. setting "quiet" kernel command line option) in order to hide such messages also prevents all other KERN_INFO messages from being printed to consoles. Since some KERN_INFO messages are worth printing to consoles while other KERN_INFO messages are worth printing to consoles, controlling with > + loglevel assigned to each message is inevitable. I think that basically only oops (e.g. WARN()/BUG()/panic()) messages worth printing to consoles and the rest messages do not worth printing to consoles. Existing KERN_$LOGLEVEL is too rough-grained.