From: Prakash Sangappa <prakash.sangappa@oracle.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mathieu.desnoyers@efficios.com" <mathieu.desnoyers@efficios.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"bigeasy@linutronix.de" <bigeasy@linutronix.de>,
"kprateek.nayak@amd.com" <kprateek.nayak@amd.com>
Subject: Re: [PATCH V3 1/4] Sched: Scheduler time slice extension
Date: Mon, 5 May 2025 01:51:39 +0000 [thread overview]
Message-ID: <C3F85063-68B5-4C6D-B95F-27B72DBFA178@oracle.com> (raw)
In-Reply-To: <20250502090643.3809b6f5@batman.local.home>
> On May 2, 2025, at 6:06 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Fri, 2 May 2025 11:05:29 +0200
> Peter Zijlstra <peterz@infradead.org> wrote:
>
>>> diff --git a/kernel/sched/syscalls.c b/kernel/sched/syscalls.c
>>> index cd38f4e9899d..1b2b64fe0fb1 100644
>>> --- a/kernel/sched/syscalls.c
>>> +++ b/kernel/sched/syscalls.c
>>> @@ -1378,6 +1378,11 @@ static void do_sched_yield(void)
>>> */
>>> SYSCALL_DEFINE0(sched_yield)
>>> {
>>> + if (IS_ENABLED(CONFIG_RSEQ) && current->sched_time_delay) {
>>> + schedule();
>>> + return 0;
>>> + }
>>> +
>>> do_sched_yield();
>>> return 0;
>>> }
>>
>> Multiple people, very much including Linus, have already said this
>> 'cute' hack isn't going to fly. Why is it still here?
>
> Who was against this?
>
> Linus objected to "optimizing yield" because it has *semantics* that
> people depend on because it has historical meaning. Things like "move
> the process to the end of the scheduling queue of that priority".
>
> https://lore.kernel.org/linux-trace-kernel/CAHk-=wgTWVF6+dKPff-mhVwngFwBu_G9+fwOTF2Ds+YPj3xkeQ@mail.gmail.com/
>
> I countered that this "optimization" would only affect those that use
> the extended time slice and would not cause any issues with current
> applications that depend on its current semantics.
Still wouldn’t that affect performance of the application using the extended time slice optimization?
A sched_yield() could end up in do_sched_yield(), if ‘shed_time_delay' is not set as the thread had been rescheduled.
>
> Linus never replied to that.
>
> Or did Linus reply to this someplace else too that I missed?
>
> If we don't do this, what would be the system call to use to tell the
> kernel that the task no longer needs extra time?
Yes, need a system call to recommend.
>
> -- Steve
next prev parent reply other threads:[~2025-05-05 1:51 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-02 1:59 [PATCH V3 0/4] " Prakash Sangappa
2025-05-02 1:59 ` [PATCH V3 1/4] Sched: " Prakash Sangappa
2025-05-02 9:05 ` Peter Zijlstra
2025-05-02 13:06 ` Steven Rostedt
2025-05-05 1:51 ` Prakash Sangappa [this message]
2025-05-05 14:48 ` Steven Rostedt
2025-05-05 15:58 ` Prakash Sangappa
2025-05-05 16:34 ` Steven Rostedt
2025-05-05 16:45 ` Steven Rostedt
2025-05-06 1:23 ` Prakash Sangappa
2025-05-06 13:13 ` Steven Rostedt
2025-05-02 15:39 ` Mathieu Desnoyers
2025-05-05 1:46 ` Prakash Sangappa
2025-05-05 1:42 ` Prakash Sangappa
2025-05-02 12:34 ` Sebastian Andrzej Siewior
2025-05-02 14:35 ` Peter Zijlstra
2025-05-02 15:27 ` Sebastian Andrzej Siewior
2025-05-02 1:59 ` [PATCH V3 2/4] Sched: Tunable to specify duration of " Prakash Sangappa
2025-05-02 1:59 ` [PATCH V3 3/4] Sched: Add scheduler stat for cpu " Prakash Sangappa
2025-05-02 1:59 ` [PATCH V3 4/4] Sched: Add tracepoint for sched " Prakash Sangappa
2025-05-02 9:14 ` Peter Zijlstra
2025-05-02 11:02 ` Sebastian Andrzej Siewior
2025-05-02 11:10 ` Peter Zijlstra
2025-05-02 12:31 ` Sebastian Andrzej Siewior
2025-05-05 1:43 ` 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=C3F85063-68B5-4C6D-B95F-27B72DBFA178@oracle.com \
--to=prakash.sangappa@oracle.com \
--cc=bigeasy@linutronix.de \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®