Files
linux/kernel/sched
Tejun Heo b7975c4869 sched_ext: Make explicit scx_task_iter_relock() calls unnecessary
During tasks iteration, the locks can be dropped using
scx_task_iter_unlock() to perform e.g. sleepable allocations. Afterwards,
scx_task_iter_relock() has to be called prior to other iteration operations,
which is error-prone. This can be easily automated by tracking whether
scx_tasks_lock is held in scx_task_iter and re-acquiring when necessary. It
already tracks whether the task's rq is locked after all.

- Add scx_task_iter->list_locked which remembers whether scx_tasks_lock is
  held.

- Rename scx_task_iter->locked to scx_task_iter->locked_task to better
  distinguish it from ->list_locked.

- Replace scx_task_iter_relock() with __scx_task_iter_maybe_relock() which
  is automatically called by scx_task_iter_next() and scx_task_iter_stop().

- Drop explicit scx_task_iter_relock() calls.

The resulting behavior should be equivalent.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Andrea Righi <arighi@nvidia.com>
2025-09-03 11:33:28 -10:00
..
2025-06-11 11:20:53 +02:00
2025-06-11 11:20:53 +02:00
2025-06-11 11:20:53 +02:00
2025-06-11 11:20:53 +02:00
2025-06-11 11:20:53 +02:00
2025-06-11 11:20:53 +02:00
2025-06-13 08:47:18 +02:00
2025-07-14 17:16:28 +02:00
2025-06-11 11:20:53 +02:00
2025-07-14 17:16:28 +02:00
2025-06-11 11:20:53 +02:00
2025-06-13 08:47:18 +02:00
2025-08-04 10:51:22 -07:00
2025-06-11 11:20:53 +02:00
2025-06-11 11:20:53 +02:00
2025-06-11 11:20:53 +02:00
2025-06-11 11:20:53 +02:00