lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <30b55100-d903-471f-acf0-12bfc31b0c9a@amd.com>
Date: Tue, 1 Jul 2025 09:29:10 +0530
From: K Prateek Nayak <kprateek.nayak@....com>
To: Prakash Sangappa <prakash.sangappa@...cle.com>,
 linux-kernel@...r.kernel.org
Cc: peterz@...radead.org, rostedt@...dmis.org,
 mathieu.desnoyers@...icios.com, tglx@...utronix.de, bigeasy@...utronix.de,
 vineethr@...ux.ibm.com
Subject: Re: [PATCH V6 3/7] Sched: Tunable to specify duration of time slice
 extension

Hello Prakash,

On 7/1/2025 6:07 AM, Prakash Sangappa wrote:
> Add a tunable to specify duration of scheduler time slice extension.
> The default will be set to 30us and the max value that can be specified
> is 100us. Setting it to 0, disables scheduler time slice extension.
> 
> Signed-off-by: Prakash Sangappa <prakash.sangappa@...cle.com>
> ---
> v5 -> v6
> - Added documentation for tunable 'sysctl_sched_preempt_delay_us'.
> ---
>   .../admin-guide/kernel-parameters.txt         |  8 ++++
>   include/linux/sched.h                         |  5 +++
>   include/uapi/linux/rseq.h                     |  5 ++-
>   kernel/rseq.c                                 |  7 +++-
>   kernel/sched/core.c                           | 40 +++++++++++++++++++
>   5 files changed, 61 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 0ee6c5314637..1e0f86cda0db 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -6398,6 +6398,14 @@
>   
>   	sched_verbose	[KNL,EARLY] Enables verbose scheduler debug messages.
>   
> +	sched_preempt_delay_us=	[KNL]
> +			Scheduler preemption delay in microseconds.
> +			Allowed range is 0 to 100us. A thread can request
> +			extending its scheduler time slice on the cpu by
> +			delaying preemption. Duration of preemption delay
> +			granted is specified by this parameter. Setting it
> +			to 0 will disable this feature.
> +

Shouldn't these bits go into Documentation/admin-guide/sysctl/kernel.rst
since this is a sysctl and not a kernel parameter?

>   	schedstats=	[KNL,X86] Enable or disable scheduled statistics.
>   			Allowed values are enable and disable. This feature
>   			incurs a small amount of overhead in the scheduler

[..snip..]

> @@ -4678,6 +4689,24 @@ static int sysctl_schedstats(const struct ctl_table *table, int write, void *buf
>   #endif /* CONFIG_PROC_SYSCTL */
>   #endif /* CONFIG_SCHEDSTATS */
>   
> +#ifdef CONFIG_PROC_SYSCTL
> +#ifdef CONFIG_RSEQ
> +static int sysctl_sched_preempt_delay(const struct ctl_table *table, int write,
> +		void *buffer, size_t *lenp, loff_t *ppos)
> +{
> +	int err;
> +
> +	err = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
> +	if (err < 0)
> +		return err;
> +	if (sysctl_sched_preempt_delay_us > SCHED_PREEMPT_DELAY_DEFAULT_US)
> +		pr_warn("Sched preemption delay time set higher then default value %d us\n",

s/then/than the/

Should we print the current value too? That way, the dmesg can read how
badly the user wanted to shoot themselves in the foot if this ever goes
sideways / has unintended effects on PREEMPT_RT.

> +			SCHED_PREEMPT_DELAY_DEFAULT_US);
> +	return err;
> +}
> +#endif /* CONFIG_RSEQ */
> +#endif /* CONFIG_PROC_SYSCTL */
> +
>   #ifdef CONFIG_SYSCTL
>   static const struct ctl_table sched_core_sysctls[] = {
>   #ifdef CONFIG_SCHEDSTATS

-- 
Thanks and Regards,
Prateek


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ