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: <953c7749-5c91-40d9-ab1a-bdf82987d256@amd.com>
Date: Tue, 1 Jul 2025 08:42:44 +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 7/7] Introduce a config option for scheduler time slice
 extension feature

Hello Prakash,

Couple of nits. inlined below.

On 7/1/2025 6:07 AM, Prakash Sangappa wrote:
> Add a config option to enable schedule time slice extension.
> 
> Signed-off-by: Prakash Sangappa <prakash.sangappa@...cle.com>
> ---
>   include/linux/entry-common.h |  2 +-
>   include/linux/sched.h        |  8 ++++----
>   init/Kconfig                 |  7 +++++++
>   kernel/rseq.c                |  5 ++++-
>   kernel/sched/core.c          | 12 ++++++------
>   kernel/sched/debug.c         |  2 +-
>   kernel/sched/syscalls.c      |  3 ++-
>   7 files changed, 25 insertions(+), 14 deletions(-)
> 
> diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
> index d4fa952e394e..351c9dc159bc 100644
> --- a/include/linux/entry-common.h
> +++ b/include/linux/entry-common.h
> @@ -402,7 +402,7 @@ static __always_inline void syscall_exit_to_user_mode_work(struct pt_regs *regs)
>   	CT_WARN_ON(ct_state() != CT_STATE_KERNEL);
>   
>   	/* reschedule if sched delay was granted */
> -	if (IS_ENABLED(CONFIG_RSEQ) && current->sched_time_delay)
> +	if (IS_ENABLED(CONFIG_SCHED_PREEMPT_DELAY) && current->sched_time_delay)

A wrapper around this would be nice. Something like
sched_delay_resched()? It can also be reused in do_sched_yield() then.
Thoughts?

>   		set_tsk_need_resched(current);
>   
>   	if (IS_ENABLED(CONFIG_PROVE_LOCKING)) {

[..snip..]

> diff --git a/init/Kconfig b/init/Kconfig
> index ce76e913aa2b..2f5f603d175a 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1130,6 +1130,13 @@ config SCHED_MM_CID
>   	def_bool y
>   	depends on SMP && RSEQ
>   
> +config SCHED_PREEMPT_DELAY
> +	def_bool y
> +	depends on SMP && RSEQ

         && SCHED_HRTICK

and then you can avoid the ugly "!IS_ENABLED(CONFIG_SCHED_HRTICK)"
checks and keep all the SCHED_PREEMPT_DELAY bits in one place
without the need to put them in the "#ifdef  CONFIG_SCHED_HRTICK"
block.

Also, are we settling for 30us delay for PREEMPT_RT too or should
this also include "&& !PREEMPT_RT"?

> +	help
> +	  This feature enables a thread to request extending its time slice on
> +	  the cpu by delaying preemption.
> +
>   config UCLAMP_TASK_GROUP
>   	bool "Utilization clamping per group of tasks"
>   	depends on CGROUP_SCHED

-- 
Thanks and Regards,
Prateek


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ