On Wed, 5 Feb 2025 08:16:35 -0500 Steven Rostedt <rostedt@xxxxxxxxxxx> 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