Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp292006ybj; Wed, 6 May 2020 17:54:11 -0700 (PDT) X-Google-Smtp-Source: APiQypJxUWWHkSaEsRqMw687hgVPriwH1/ppfakVWtrkWxf5DiIaYtapHauE/hDyDIPTlgJvrPtv X-Received: by 2002:aa7:cfc3:: with SMTP id r3mr9972984edy.342.1588812851452; Wed, 06 May 2020 17:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588812851; cv=none; d=google.com; s=arc-20160816; b=eXUz7z+LPImli+ULpvQwSpfVOsIMV87yuRIrFQM/EnraZ+gf4qiHn0gZNxEIkqq5P6 imDMV5ovl4XpHp/v26mhAIhXmcupX57N8Z6RHMACjPH1Gj9646GVNu2mDnuDURczaNIH vKyFO8AOaTHwg/wKWbwE72zolcROE6BT3KgMJ/yaExNtITzIVHBQIyT2VJDgPcPhLGI4 FDlUXrESWxMUgIZd5zqOfpoxqZTKAWAt9S0FsxV7PME7uW+myFhoUD8h2Ebwu1WExmwA AE85b4SPsiNqgI4Z9ctYh/pMDon83qwVMVapkTK24kHCqfOgw70FMQzDNhmfi+tc2gaO I7nA== 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=00MyQWVJaYc8Nl9Z8TnR0scBGR2lahA6hiukZ6GbGTQ=; b=sSHBzj4IQ3wQFH2ZEwu4VObolHDwU7C16HgF7qHWQDBmnGzC1VHvrYzHVa7YdHdO1i V/8h+gpAWw4cY2r2o2yhSQ2e1SF7DaYh/lciGg9I5tIR6H4osKLvfO/DA93k+1ktnBXX tPQjX7ayEsTEqCvTVHhNxPSZNAG4YpSkCN5suF6KjY8X1QRMxnN5wXkkeGLbM8vgjSSW MjSQSCV8BQ15e9zctKe4C9D1TMWK2snyuYuIE9RgXzBouhPEv/pTY9T/x4z59EI0RpPl V1ZKzcx3WPHBjoZ7daaXL8Sx8ejejQN85WgZKP1lbi/F+gfY+yfxGuJKQHQgf3XDQRQd nNxA== 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 d24si2113120edy.387.2020.05.06.17.53.48; Wed, 06 May 2020 17:54:11 -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 S1727933AbgEGAua (ORCPT + 99 others); Wed, 6 May 2020 20:50:30 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:54202 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbgEGAua (ORCPT ); Wed, 6 May 2020 20:50:30 -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 0470oSn8075002; Thu, 7 May 2020 09:50:28 +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); Thu, 07 May 2020 09:50:28 +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 0470oS9h074998 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 May 2020 09:50:28 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH] printk: Add loglevel for "do not print to consoles". To: Joe Perches Cc: Sergey Senozhatsky , Petr Mladek , Steven Rostedt , linux-kernel@vger.kernel.org, Dmitry Safonov , Michal Hocko , 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> <344199f1-639b-ee93-2388-57b0549641f9@i-love.sakura.ne.jp> From: Tetsuo Handa Message-ID: <0d513c80-8c8e-17b6-5b9c-73c7bca77252@i-love.sakura.ne.jp> Date: Thu, 7 May 2020 09:50:21 +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: 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/07 0:26, Joe Perches wrote: > On Wed, 2020-05-06 at 18:45 +0900, Tetsuo Handa wrote: >> On 2020/04/28 20:33, Tetsuo Handa wrote: >>> On 2020/04/27 15:21, Sergey Senozhatsky wrote: >>>>> KERN_NO_CONSOLES is for type of messages where "saved for later analysis" is >>>>> important but "printed for immediate notification" is not important. >>>>> In other words, KERN_NO_CONSOLES is NOT for dying messages where "printed for >>>>> immediate notification" is important. >>>> >>>> per-console loglevel is a user configurable parameter. >>>> KERN_NO_CONSOLES is a hard-coded policy. >>> >>> But given that whether to use KERN_NO_CONSOLES is configurable via e.g. sysctl, >>> KERN_NO_CONSOLES will become a user configurable parameter. What's still wrong? >>> >> >> Any problems remaining? > > printk_get_level / printk_skip_level and the various > uses of %pV using printk_get_level > Excuse me, but what do you mean? I wish printk() accepts "loglevel" argument detached from "fmt" argument (e.g. int printkl(int loglevel, const char *fmt_without_loglevel, ...); int vprintkl(int loglevel, const char *fmt_without_loglevel, va_list args); ) so that users of KERN_NO_CONSOLES need not to do like if (sysctl_no_console_for_XX) printk(KERN_INFO KERN_NO_CONSOLES pr_fmt(fmt) "%s\n", "hello"); else printk(KERN_INFO pr_fmt(fmt) "%s\n", "hello"); or printk("%s" pr_fmt(fmt) "%s\n", sysctl_no_console_for_XX ? KERN_INFO KERN_NO_CONSOLES : KERN_INFO, "hello"); in order to conditionally embed KERN_NO_CONSOLES into pr_info("%s\n", "hello"); . But this patch is about whether KERN_NO_CONSOLES is acceptable. How to pass KERN_NO_CONSOLES (if KERN_NO_CONSOLES is acceptable) is a future patch.