Thread (29 messages) 29 messages, 6 authors, 2025-02-05

Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice

From: Peter Zijlstra <peterz@infradead.org>
Date: 2025-02-01 11:59:32
Also in: linux-mm, lkml

On Fri, Jan 31, 2025 at 05:58:38PM -0500, Steven Rostedt wrote:
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

This is to improve user space implemented spin locks or any critical
section. It may also be extended for VMs and their guest spin locks as
well, but that will come later.

This adds a new field in the struct rseq called cr_counter. This is a 32 bit
field where bit zero is a flag reserved for the kernel, and the other 31
bits can be used as a counter (although the kernel doesn't care how they
are used, as any bit set means the same).

This works in tandem with PREEMPT_LAZY, where a task can tell the kernel
via the rseq structure that it is in a critical section (like holding a
spin lock) that it will be leaving very shortly, and to ask the kernel to
not preempt it at the moment.
I still have full hate for this approach.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help