[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250205084449.1bca619d@gandalf.local.home>
Date: Wed, 5 Feb 2025 08:44:49 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: 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, 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@...cle.com, konrad.wilk@...cle.com, jgross@...e.com,
andrew.cooper3@...rix.com, Joel Fernandes <joel@...lfernandes.org>, 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>, bigeasy@...utronix.de, daniel.wagner@...e.com,
joseph.salisbury@...cle.com, broonie@...il.com
Subject: Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice
On Wed, 5 Feb 2025 08:10:19 -0500
Steven Rostedt <rostedt@...dmis.org> wrote:
> The preemption method will influence that decision, but user space doesn't
> need to be know.
If your issue is that this depends on the preemption method, I have a
slight change to make it work for all preemption methods. I just replied to
Joel about this:
https://lore.kernel.org/all/20250205083857.3cc06aa7@gandalf.local.home/
I'll repeat some of it here.
Currently we have:
TYPE | Sched Tick | RT Wakeup |
===========+=======================+======================+
None | NEED_RESCHED_LAZY | NEED_RESCHED_LAZY |
-----------+-----------------------+----------------------+
Voluntary | NEED_RESCHED_LAZY | NEED_RESCHED |
-----------+-----------------------+----------------------+
Full | NEED_RESCHED | NEED_RESCHED |
-----------+-----------------------+----------------------+
Now, if we set NEED_RESCHED_LAZY in PREEMPT_FULL (and PREEMPT_RT) on a
scheduler tick if it interrupted user space (not the kernel) then we have
this:
TYPE | Sched Tick | RT Wakeup |
===========+===================================+======================+
None | NEED_RESCHED_LAZY | NEED_RESCHED_LAZY |
-----------+-----------------------------------+----------------------+
Voluntary | NEED_RESCHED_LAZY | NEED_RESCHED |
-----------+-----------------------------------+----------------------+
Full | NEED_RESCHED or NEED_RESCHED_LAZY | NEED_RESCHED |
-----------+-----------------------------------+----------------------+
Then going back to user space from the interrupt, we can use rseq and the
LAZY bit to know if we should extend the tick or not! Even without rseq,
this would behave the same as NEED_RESCHED_LAZY will schedule just like
NEED_RESCHED when going back to user space.
This will allow this schedule tick extension to work in all the preemption
methods.
Would this be something you are more OK with? I can go and test this out.
-- Steve
Powered by blists - more mailing lists