lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250205083857.3cc06aa7@gandalf.local.home>
Date: Wed, 5 Feb 2025 08:38:57 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Joel Fernandes <joel@...lfernandes.org>
Cc: 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>, bigeasy@...utronix.de,
 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, 5 Feb 2025 08:16:35 -0500
Steven Rostedt <rostedt@...dmis.org> wrote:

> Correct. And why I don't think this should be used for RT. It's SCHED_OTHER
> that doesn't have any control of the sched tick, where this hint can help.

Honestly, I don't care that much if it is used on all preemption models,
but I do care if it affects RT tasks. The LAZY flag just happens to let us
know if the next schedule is mandatory or not. NEED_RESCHED_LAZY means,
this schedule is not that important, where as the NEED_RESCHED means it is.

That's why I picked that to decide if the task can get extended or not. Has
nothing to do with the preemption method. The preemption method currently
sets that flag.

Now we could just change when NEED_RESCHED_LAZY is set and this could work
with all preemption methods.

To explain this better. 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     |
-----------+-----------------------+----------------------+

Perhaps if we do:

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      |
-----------+-----------------------------------+----------------------+

Where on the scheduler tick, for PREEMPT_FULL (and even PREEMPT_RT), we set
NEED_RESCHED if the task is in the kernel and NEED_RESCHED_LAZY if it is in
user space then this patch will work in all preemption methods. As the LAZY
bit will decide if the task gets extended or not.

That is, any SCHED_OTHER task that is being preempted due to its scheduler
tick can be granted 50us more, regardless of the preemption method.

Now on PREEMPT_NONE, it may even get to preempt a RT task a bit more, but
RT tasks have more to worry about if they are running on a PREEMPT_NONE
system anyway!

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ