public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Prakash Sangappa <prakash.sangappa@oracle.com>,
	linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, rostedt@goodmis.org,
	mathieu.desnoyers@efficios.com, tglx@linutronix.de,
	bigeasy@linutronix.de, vineethr@linux.ibm.com
Subject: Re: [PATCH V6 7/7] Introduce a config option for scheduler time slice extension feature
Date: Tue, 1 Jul 2025 08:42:44 +0530	[thread overview]
Message-ID: <953c7749-5c91-40d9-ab1a-bdf82987d256@amd.com> (raw)
In-Reply-To: <20250701003749.50525-8-prakash.sangappa@oracle.com>

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


  reply	other threads:[~2025-07-01  3:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-01  0:37 [PATCH V6 0/7] Scheduler time slice extension Prakash Sangappa
2025-07-01  0:37 ` [PATCH V6 1/7] Sched: " Prakash Sangappa
2025-07-01  8:42   ` Thomas Gleixner
2025-07-01 10:56     ` Peter Zijlstra
2025-07-01 11:28       ` K Prateek Nayak
2025-07-01 11:40         ` Peter Zijlstra
2025-07-01 12:36       ` Thomas Gleixner
2025-07-01 14:49         ` Steven Rostedt
2025-07-03  5:38         ` Prakash Sangappa
2025-07-03  8:32           ` Thomas Gleixner
2025-07-01 18:40     ` Prakash Sangappa
2025-07-01  0:37 ` [PATCH V6 2/7] Sched: Indicate if thread got rescheduled Prakash Sangappa
2025-07-01  0:37 ` [PATCH V6 3/7] Sched: Tunable to specify duration of time slice extension Prakash Sangappa
2025-07-01  3:59   ` K Prateek Nayak
2025-07-01  0:37 ` [PATCH V6 4/7] Sched: Add scheduler stat for cpu " Prakash Sangappa
2025-07-01  0:37 ` [PATCH V6 5/7] Sched: Add tracepoint for sched " Prakash Sangappa
2025-07-01  0:37 ` [PATCH V6 6/7] Add API to query supported rseq cs flags Prakash Sangappa
2025-07-01  0:37 ` [PATCH V6 7/7] Introduce a config option for scheduler time slice extension feature Prakash Sangappa
2025-07-01  3:12   ` K Prateek Nayak [this message]
2025-07-01 17:47     ` Prakash Sangappa
2025-07-01  8:46   ` Thomas Gleixner
2025-07-01 19:04     ` Prakash Sangappa
2025-07-01  4:30 ` [PATCH V6 0/7] Scheduler time slice extension K Prateek Nayak
2025-07-01 19:04   ` Prakash Sangappa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=953c7749-5c91-40d9-ab1a-bdf82987d256@amd.com \
    --to=kprateek.nayak@amd.com \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=peterz@infradead.org \
    --cc=prakash.sangappa@oracle.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=vineethr@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox