From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 144272253B0 for ; Mon, 15 Dec 2025 16:06:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765814807; cv=none; b=rKgzGBUSTDTuZ7T+7lkIh2i07Bn1zOp71p0eLny98yRMcyGm1UbeQ+vJcNECHOMMmfEfVJjmQQ105JsCzke+Bx21vD9ZI0DyroMSR7m4pCiKRF11+dvg9v7YpKkgUzyTWrIr5tNe7Kv/28ciNw8hI8XPcyoCJNAQgwpkbY5+N3E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765814807; c=relaxed/simple; bh=sy9mNOi4tWwZYdRWKGfTgYHFcjWV3sHFPatpdPtJ57Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ALTXnF4gYJy13BWcQ6k/uVtAXvN+pisdAcsQUPzYkYKD1WmTRl+nXmRGxGolxQ5GSnvz56nxJE1CLIpBHfiOvFXMCGsI2JaO7uIhVgdO/4SLoGVe/kytbPkUS4nldA0EVvOs4mHT66R+t/PzUHJGUE0fgCg/38CMzmQysCjVLyw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=MTiGnvGi; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="MTiGnvGi" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-42fb03c3cf2so2086646f8f.1 for ; Mon, 15 Dec 2025 08:06:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1765814803; x=1766419603; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=nA083pPiiPI/D3uO1OCL9UyHdL0/5MNdtZt1hmGi1Xg=; b=MTiGnvGiCx07mTkj9bPCUpOQoLWvGXnmHpEydOIWW4qK6JePLz7DBPG7Z2QkJ4nEwH JbXcKiWuwISremi6iozfEytFqFwIqpKniGOpvyhvb4K3B9WHh5tvLzXwxAXM+rACZF23 nGPINDwf7zZWI7muyvQ9AynUhB6t6DdKKDisR64aj526ulAlWTIniuAy+mvZIEwg1Y3z JvslXdt6wdecHuuXDtPh5IxbnWQeYiaQk1fy2wIRvy3MW6FlY61PVALYFMVzYA9aWkwE 8LY4JbpjVmEgWjLE/x2nXR7h1g8R5wjXErsQ/U46qjTzm/qGll+Hpa5A7JZRFIge32M/ +bPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765814803; x=1766419603; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nA083pPiiPI/D3uO1OCL9UyHdL0/5MNdtZt1hmGi1Xg=; b=iP8N0uetQftTlBJ3laSlRnJ67Bt9DEfpIwH8If7Lq1TU6f03UckYeaeTGIaNjHP6Pe arkHeiecuayJbxBQzx1ow7EsSWFukhxgBARgBkqjWtqQs2WD6h/QzAW/4AzHuDjnH3Br r8UoawL3fAt8iJDkL5l8r6QWhLYwr+cY6Cy6QTXdAtNUFoauIihd5s8POl4j1dM9tE70 GIBbdhnllJouvReSJ/Fei60Jrg5NTrjFtSQk9Kdqqo+Lf9HcvE90PkPOMWBICRm4SBSY I4oo3nuS5wa8loEFJ7iW19ZHREoM6YseXoF86rBTCr7ZL2qYLoWPA//uAOyvNVJnYJuX OwyQ== X-Forwarded-Encrypted: i=1; AJvYcCVozDyT+DBYYOOgQH3DVuDIrSstKlsvSsAsAmmeoouiCr/YTyrp9qxL9XK5IVSljll9cKKvYX4hK2tYB8A=@vger.kernel.org X-Gm-Message-State: AOJu0YzrGFjhU10N2Tiz3yqu4hagiI6muT1wtn0j7OctmTbuhzB8Y+fe Oo69dFc4WSJv7+D8XIC2VoiWQeA1hCYzqYWXwf8ejM5sr2a//EyeMelplGhC0UxlX0w= X-Gm-Gg: AY/fxX72CntP2StJ357hO8W+AEHT+ZDFc/b2b4eeXBrOipQK+ybYy5ZpzUAeyhc7bM2 oNXeyB0njrYl8+++N7J9ScPvY7bJyWbiInD59DsOHFKOLhyqzlWwaxo6mn4eaHT0OUxqUYTBc7L 0REga0eqvp+tJKH28sDlU30yUFgfAXhKdtqpeqJip8yWZsV2SdzJO2NVL0BGMYANbw8T3+o+UZ5 rK5qtoMfZf6YVq60K72VYK/JrwSjWHm2gmSmzV2Y00FQ4D+1H2Rd7ZpQK2VgNTVnU+KqBqhkO48 C2tQeVMGEo8kzFTx2SV3uj0jxwm5MPYBAjVXyN81mb+Oy+7YuDkCWKgTd/vmK66a4IegPVLE+nC 7QpfqntydctZqSN9+1t16xXGD7a+DLLW5XdDQfoL01hGH1PJcUfb4GHwlaHHn/GkjRSCJc0kFIQ 2MNN6pmgyQSMweBA== X-Google-Smtp-Source: AGHT+IH7dsFhEmOA0tl9fAv3FA6+0f49rXYCsxt0t3UTR1q5PPoi7hjaz5gBNCxZbs6vjdY14dQt7A== X-Received: by 2002:a05:6000:200d:b0:430:f985:a7b2 with SMTP id ffacd0b85a97d-430f985a9e8mr4364287f8f.51.1765814803182; Mon, 15 Dec 2025 08:06:43 -0800 (PST) Received: from pathway ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-430f1fa232csm15891431f8f.6.2025.12.15.08.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Dec 2025 08:06:42 -0800 (PST) Date: Mon, 15 Dec 2025 17:06:40 +0100 From: Petr Mladek To: Joel Granados Cc: Chris Down , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Sergey Senozhatsky , Steven Rostedt , John Ogness , Geert Uytterhoeven , Tony Lindgren , kernel-team@fb.com Subject: Re: [PATCH v8 20/21] printk: Deprecate the kernel.printk sysctl interface Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon 2025-12-15 10:52:28, Joel Granados wrote: > On Fri, Dec 12, 2025 at 04:51:46PM +0100, Petr Mladek wrote: > > Added Joel into Cc for the sysrq API changes. > Thx. I have just two comments (inline) > > > > > On Fri 2025-11-28 03:44:33, Chris Down wrote: > > > The kernel.printk sysctl interface is deprecated in favour of more > > > granular and clearer sysctl interfaces for controlling loglevels, namely > > > kernel.console_loglevel and kernel.default_message_loglevel. > > > > > > - Encourage users to adopt the new, dedicated sysctl interfaces > > > (kernel.console_loglevel and kernel.default_message_loglevel), which > > > are more straightforward and easier to understand. > > > - Improve input validation and error handling, ensuring that users > > > receive appropriate feedback when setting invalid values. > > > - Simplify the configuration of loglevels by exposing only the controls > > > that are necessary and relevant. > > > > > > --- a/kernel/printk/sysctl.c > > > +++ b/kernel/printk/sysctl.c > > > @@ -67,13 +68,24 @@ static int proc_dointvec_console_loglevel(const struct ctl_table *table, > > > do_proc_dointvec_console_loglevel, NULL); > > > } > > > > > > +static int proc_dointvec_printk_deprecated(const struct ctl_table *table, int write, > > > + void *buffer, size_t *lenp, loff_t *ppos) > > > +{ > > > + int res = proc_dointvec(table, write, buffer, lenp, ppos); > > > + > > > + if (write) > This would print out a warning when the user writes to the file. > I have some questions here: > 1. Is this sysctl to be completely removed in the future? I hope so. > 2. Shouldn't you warn on read as well (if it is going to be completely > removed). Makes perfect sense. We should. > 3. Is there a plan for when this will be completely removed? Is there a > date? Honeslty, I do not have much experience with removing such API. I am not sure how aggressive we could be. For example, it seems that it is going to take 15 years to obsolete automounting of tracefs in debugfs. But they added the warning 10 years after adding tracefs, see commit 9ba817fb7c6afd3 ("tracing: Deprecate auto-mounting tracefs in debugfs"). > 4. Should you put that date in the message? It would be useful. What about doing it in 10 years from now? > > > + pr_warn_once("printk: The kernel.printk sysctl is deprecated. Consider using kernel.console_loglevel or kernel.default_message_loglevel instead.\n"); > Line seems very long. cut it in two? OK, what about the following? pr_warn_once("printk: The kernel.printk sysctl is deprecated and will be removed in 2036.\n"); pr_warn_once("printk: Use kernel.console_loglevel or kernel.default_message_loglevel instead.\n"); > > These changes work because the sysctl API changes were backward > > compatible. But it would be nice to follow the new parameter names, > > ... > > > > I propose to do: > > > > + renamed @write to @dir > > + use SYSCTL_USER_TO_KERN(dir) macro > This looks good to me. Thanks for checking and feedback. Best Regards, Petr