From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Joel Fernandes <joel@joelfernandes.org>,
Prakash Sangappa <prakash.sangappa@oracle.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Ankur Arora <ankur.a.arora@oracle.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-mm@kvack.org, x86@kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
luto@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com,
hpa@zytor.com, juri.lelli@redhat.com, vincent.guittot@linaro.org,
willy@infradead.org, mgorman@suse.de, jon.grimm@amd.com,
bharata@amd.com, raghavendra.kt@amd.com,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Konrad Wilk <konrad.wilk@oracle.com>,
jgross@suse.com, Andrew.Cooper3@citrix.com,
Vineeth Pillai <vineethrp@google.com>,
Suleiman Souhlal <suleiman@google.com>,
Ingo Molnar <mingo@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Clark Williams <clark.williams@gmail.com>,
daniel.wagner@suse.com,
Joseph Salisbury <joseph.salisbury@oracle.com>,
broonie@gmail.com
Subject: Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice
Date: Wed, 12 Feb 2025 13:11:13 +0100 [thread overview]
Message-ID: <20250212121113.3nJ-kf-6@linutronix.de> (raw)
In-Reply-To: <20250211102801.5b32d610@gandalf.local.home>
On 2025-02-11 10:28:01 [-0500], Steven Rostedt wrote:
> On Tue, 11 Feb 2025 09:21:38 +0100
> Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
>
> > We don't follow this behaviour exactly today.
> >
> > Adding this behaviour back vs the behaviour we have now, doesn't seem to
> > improve anything at visible levels. We don't have a counter but we can
> > look at the RCU nesting counter which should be zero once locks have
> > been dropped. So this can be used for testing.
> >
> > But as I said: using "run to completion" and preempt on the return
> > userland rather than once the lazy flag is seen and all locks have been
> > released appears to be better.
> >
> > It is (now) possible that you run for a long time and get preempted
> > while holding a spinlock_t. It is however more likely that you release
> > all locks and get preempted while returning to userland.
>
> IIUC, today, LAZY causes all SCHED_OTHER tasks to act more like
> PREEMPT_NONE. Is that correct?
Well. First sched-tick will set the LAZY bit, the second sched-tick
forces a resched.
On PREEMPT_NONE the sched-tick would be set NEED_RESCHED while nothing
will force a resched until the task decides to do schedule() on its own.
So it is slightly different for kernel threads.
Unless we talk about userland, here we would have a resched on the
return to userland after the sched-tick LAZY or NONE does not matter.
> Now that the PREEMPT_RT is not one of the preemption selections, when you
> select PREEMPT_RT, you can pick between CONFIG_PREEMPT and
> CONFIG_PREEMPT_LAZY. Where CONFIG_PREEMPT will preempt the kernel at the
> scheduler tick if preemption is enabled and CONFIG_PREEMPT_LAZY will
> not preempt the kernel on a scheduler tick and wait for exit to user space.
This is not specific to RT but FULL vs LAZY. But yes. However the second
sched-tick will force preemption point even without the
exit-to-userland.
> Sebastian,
>
> It appears you only tested the CONFIG_PREEMPT_LAZY selection. Have you
> tested the difference of how CONFIG_PREEMPT behaves between PREEMPT_RT and
> no PREEMPT_RT? I think that will show a difference like we had in the past.
Not that I remember testing PREEMPT vs PREEMPT_RT. I remember people
complained about high networking load on RT which become visible due to
threaded interrupts (as in top) while for non-RT it was more or less
hidden and not clearly visible due to selected accounting. The network
performance was mostly the same as far as I remember (that is gbit).
> I can see people picking both PREEMPT_RT and CONFIG_PREEMPT (Full), but
> then wondering why their non RT tasks are suffering from a performance
> penalty from that.
We might want to opt in for lazy by default on RT. That was the case in
the RT queue until it was replaced with PREEMPT_AUTO.
But then why not use LAZY in favour of PREEMPT. Mike had numbers
https://lore.kernel.org/all/9df22ebbc2e6d426099bf380477a0ed885068896.camel@gmx.de/
where LAZY had mostly the voluntary performance with less context
switches than preempt. Which means also without the need for
cond_resched() and friends.
> -- Steve
Sebastian
next prev parent reply other threads:[~2025-02-12 12:11 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-31 22:58 [RFC][PATCH 0/2] sched: Extended Scheduler Time Slice revisited Steven Rostedt
2025-01-31 22:58 ` [RFC][PATCH 1/2] sched: Extended scheduler time slice Steven Rostedt
2025-02-01 11:59 ` Peter Zijlstra
2025-02-01 12:47 ` Steven Rostedt
2025-02-01 18:11 ` Peter Zijlstra
2025-02-01 23:06 ` Steven Rostedt
2025-02-03 8:43 ` Peter Zijlstra
2025-02-03 8:53 ` Peter Zijlstra
2025-02-03 16:45 ` Steven Rostedt
2025-02-04 3:28 ` Suleiman Souhlal
2025-02-04 3:57 ` Steven Rostedt
2025-02-04 9:16 ` Peter Zijlstra
2025-02-04 12:51 ` Steven Rostedt
2025-02-04 13:16 ` Steven Rostedt
2025-02-04 15:05 ` Steven Rostedt
2025-02-04 15:30 ` Peter Zijlstra
2025-02-04 16:11 ` Steven Rostedt
2025-02-05 9:07 ` Peter Zijlstra
2025-02-05 13:10 ` Steven Rostedt
2025-02-05 13:44 ` Steven Rostedt
2025-02-04 22:44 ` Prakash Sangappa
2025-02-05 0:56 ` Joel Fernandes
2025-02-05 3:04 ` Steven Rostedt
2025-02-05 5:09 ` Joel Fernandes
2025-02-05 13:16 ` Steven Rostedt
2025-02-05 13:38 ` Steven Rostedt
2025-02-05 21:08 ` Prakash Sangappa
2025-02-05 21:19 ` Steven Rostedt
2025-02-05 21:33 ` Steven Rostedt
2025-02-05 21:36 ` Prakash Sangappa
2025-02-06 3:07 ` Joel Fernandes
2025-02-06 13:30 ` Steven Rostedt
2025-02-06 13:44 ` Sebastian Andrzej Siewior
2025-02-06 13:48 ` Peter Zijlstra
2025-02-06 13:53 ` Sebastian Andrzej Siewior
2025-02-06 13:57 ` Peter Zijlstra
2025-02-06 14:20 ` Steven Rostedt
2025-02-06 14:22 ` Sebastian Andrzej Siewior
2025-02-06 14:27 ` Peter Zijlstra
2025-02-06 14:57 ` Steven Rostedt
2025-02-06 15:01 ` Sebastian Andrzej Siewior
2025-02-10 19:43 ` Steven Rostedt
2025-02-10 22:04 ` David Laight
2025-02-10 22:15 ` Steven Rostedt
2025-02-11 8:21 ` Sebastian Andrzej Siewior
2025-02-11 10:57 ` Peter Zijlstra
2025-02-11 15:28 ` Steven Rostedt
2025-02-12 12:11 ` Sebastian Andrzej Siewior [this message]
2025-02-12 15:00 ` Steven Rostedt
2025-02-12 15:18 ` Sebastian Andrzej Siewior
2025-02-10 14:07 ` Joel Fernandes
2025-02-10 19:48 ` Steven Rostedt
2025-02-10 17:20 ` David Laight
2025-02-10 17:27 ` Steven Rostedt
2025-02-10 19:44 ` Steven Rostedt
2025-02-10 21:51 ` David Laight
2025-02-10 21:58 ` Steven Rostedt
2025-02-01 14:35 ` Mathieu Desnoyers
2025-02-01 23:08 ` Steven Rostedt
2025-02-01 23:18 ` Linus Torvalds
2025-02-01 23:35 ` Linus Torvalds
2025-02-02 3:26 ` Steven Rostedt
2025-02-02 3:22 ` Steven Rostedt
2025-02-02 7:22 ` Matthew Wilcox
2025-02-02 22:29 ` Steven Rostedt
2025-01-31 22:58 ` [RFC][PATCH 2/2] sched: Shorten time that tasks can extend their time slice for Steven Rostedt
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=20250212121113.3nJ-kf-6@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=Andrew.Cooper3@citrix.com \
--cc=akpm@linux-foundation.org \
--cc=ankur.a.arora@oracle.com \
--cc=bharata@amd.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=broonie@gmail.com \
--cc=clark.williams@gmail.com \
--cc=daniel.wagner@suse.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=joel@joelfernandes.org \
--cc=jon.grimm@amd.com \
--cc=joseph.salisbury@oracle.com \
--cc=juri.lelli@redhat.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=prakash.sangappa@oracle.com \
--cc=raghavendra.kt@amd.com \
--cc=rostedt@goodmis.org \
--cc=suleiman@google.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vincent.guittot@linaro.org \
--cc=vineethrp@google.com \
--cc=willy@infradead.org \
--cc=x86@kernel.org \
/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