[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250212100001.2e129b62@gandalf.local.home>
Date: Wed, 12 Feb 2025 10:00:01 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Joel Fernandes <joel@...lfernandes.org>, Prakash Sangappa
<prakash.sangappa@...cle.com>, Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, Thomas
Gleixner <tglx@...utronix.de>, Ankur Arora <ankur.a.arora@...cle.com>,
Linus Torvalds <torvalds@...ux-foundation.org>, linux-mm@...ck.org,
x86@...nel.org, Andrew Morton <akpm@...ux-foundation.org>, luto@...nel.org,
bp@...en8.de, dave.hansen@...ux.intel.com, hpa@...or.com,
juri.lelli@...hat.com, vincent.guittot@...aro.org, willy@...radead.org,
mgorman@...e.de, jon.grimm@....com, bharata@....com,
raghavendra.kt@....com, Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Konrad Wilk <konrad.wilk@...cle.com>, jgross@...e.com,
Andrew.Cooper3@...rix.com, Vineeth Pillai <vineethrp@...gle.com>, Suleiman
Souhlal <suleiman@...gle.com>, Ingo Molnar <mingo@...nel.org>, Mathieu
Desnoyers <mathieu.desnoyers@...icios.com>, Clark Williams
<clark.williams@...il.com>, daniel.wagner@...e.com, Joseph Salisbury
<joseph.salisbury@...cle.com>, broonie@...il.com
Subject: Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice
On Wed, 12 Feb 2025 13:11:13 +0100
Sebastian Andrzej Siewior <bigeasy@...utronix.de> wrote:
> > 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.
Except that it should schedule on a cond_resched() and the point of adding
LAZY was to get rid of all the cond_resched() which in turn gets rid of the
need for PREEMPT_NONE. Which was what I was getting at. That PREEMPT_LAZY
is really just NONE without the need to sprinkle cond_resched() all over
the kernel. Instead of having cond_resched(), we just wait for the next
tick.
>
> 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
Not true. PREEMPT_RT use to enable PREEMPT_FULL as well (it would preempt
everywhere). The issue we found was that spin_locks which would not have
been preempted by just FULL alone were being preempted when RT was enabled.
That caused a lot more contention with spin locks in the kernel.
That is PREEMPT_RT with PREEMPT_FULL will have a noticeable performance
degradation compared to just PREEMPT_FULL alone.
> sched-tick will force preemption point even without the
> exit-to-userland.
>
My question still stands. Have you compared PREEMPT_FULL with and without
PREEMPT_RT?
-- Steve
Powered by blists - more mailing lists