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: <E7A1DA29-9819-4A45-BCA5-8CBC5DC423C7@oracle.com>
Date: Tue, 1 Jul 2025 17:47:26 +0000
From: Prakash Sangappa <prakash.sangappa@...cle.com>
To: K Prateek Nayak <kprateek.nayak@....com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "rostedt@...dmis.org"
	<rostedt@...dmis.org>,
        "mathieu.desnoyers@...icios.com"
	<mathieu.desnoyers@...icios.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "bigeasy@...utronix.de" <bigeasy@...utronix.de>,
        "vineethr@...ux.ibm.com"
	<vineethr@...ux.ibm.com>
Subject: Re: [PATCH V6 7/7] Introduce a config option for scheduler time slice
 extension feature



> On Jun 30, 2025, at 8:12 PM, K Prateek Nayak <kprateek.nayak@....com> wrote:
> 
> 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?
> 

Ok, will do that.

>>   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.

Sure, I should have included SCHED_HRTICK. 
Will make that change.

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

Yes, 30us is the default. This needs to be decided. 
If we decide that scheduler time slice extension should be disabled for PREEMPT_RT
then I will 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 for looking into it.
-Prakash

> Thanks and Regards,
> Prateek
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ