]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rseq: Reset slice extension when scheduled
authorThomas Gleixner <tglx@linutronix.de>
Mon, 15 Dec 2025 16:52:26 +0000 (17:52 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 22 Jan 2026 10:11:18 +0000 (11:11 +0100)
commit7ee58f98b59b0ec32ea8a92f0bc85cb46fcd3de3
tree5efbc3da1209859f88b6a864814590ea8bb88f5a
parent0ac3b5c3dc45085b28a10ee730fb2860841f08ef
rseq: Reset slice extension when scheduled

When a time slice extension was granted in the need_resched() check on exit
to user space, the task can still be scheduled out in one of the other
pending work items. When it gets scheduled back in, and need_resched() is
not set, then the stale grant would be preserved, which is just wrong.

RSEQ already keeps track of that and sets TIF_RSEQ, which invokes the
critical section and ID update mechanisms.

Utilize them and clear the user space slice control member of struct rseq
unconditionally within the existing user access sections. That's just an
unconditional store more in that path.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/20251215155709.131081527@linutronix.de
include/linux/rseq_entry.h