[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6204274d-a6b7-4e37-8e5c-deb1caa98317@infradead.org>
Date: Wed, 29 Oct 2025 10:23:21 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>, LKML <linux-kernel@...r.kernel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
 Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
 "Paul E. McKenney" <paulmck@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
 Jonathan Corbet <corbet@....net>,
 Prakash Sangappa <prakash.sangappa@...cle.com>,
 Madadi Vineeth Reddy <vineethr@...ux.ibm.com>,
 K Prateek Nayak <kprateek.nayak@....com>,
 Steven Rostedt <rostedt@...dmis.org>,
 Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
 Arnd Bergmann <arnd@...db.de>, linux-arch@...r.kernel.org
Subject: Re: [patch V3 03/12] rseq: Provide static branch for time slice
 extensions
On 10/29/25 6:22 AM, Thomas Gleixner wrote:
> Guard the time slice extension functionality with a static key, which can
> be disabled on the kernel command line.
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: "Paul E. McKenney" <paulmck@...nel.org>
> Cc: Boqun Feng <boqun.feng@...il.com>
> ---
> V3: Document command line parameter - Sebastian
> V2: Return 1 from __setup() - Prateek
> ---
>  Documentation/admin-guide/kernel-parameters.txt |    5 +++++
>  include/linux/rseq_entry.h                      |   11 +++++++++++
>  kernel/rseq.c                                   |   17 +++++++++++++++++
>  3 files changed, 33 insertions(+)
> 
> --- a/kernel/rseq.c
> +++ b/kernel/rseq.c
> @@ -484,3 +484,20 @@ SYSCALL_DEFINE4(rseq, struct rseq __user
>  efault:
>  	return -EFAULT;
>  }
> +
> +#ifdef CONFIG_RSEQ_SLICE_EXTENSION
> +DEFINE_STATIC_KEY_TRUE(rseq_slice_extension_key);
> +
> +static int __init rseq_slice_cmdline(char *str)
> +{
> +	bool on;
> +
> +	if (kstrtobool(str, &on))
> +		return -EINVAL;
The norm for __setup function returns is:
		return 0;	/* param not handled - will be added to ENV */
or
		return 1;	/* param is handled (anything non-zero) */
Anything non-zero means param is handled, so maybe -EINVAL is OK here,
since return 0 means that the string is added to init's environment.
If the parsing function recognizes the cmdline option string
(rseq_slice_ext) but the value is invalid, it should pr_error()
or something like that but still return 1; (IMHO).
No need to have "rseq_slice_ext=foo" added to init's ENV.
So return -EINVAL is like return 1 in this case.
IOW it works as needed.  :)
> +
> +	if (!on)
> +		static_branch_disable(&rseq_slice_extension_key);
> +	return 1;
> +}
> +__setup("rseq_slice_ext=", rseq_slice_cmdline);
> +#endif /* CONFIG_RSEQ_SLICE_EXTENSION */
-- 
~Randy
Powered by blists - more mailing lists
 
