Re: [patch V6 08/11] rseq: Reset slice extension when scheduled

From: Mathieu Desnoyers
Date: Tue Dec 16 2025 - 10:21:58 EST


On 2025-12-15 13:24, Thomas Gleixner wrote:
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.

Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>

--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com