summaryrefslogtreecommitdiff
path: root/rust/helpers/rcu.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2025-09-03 11:33:28 -1000
committerTejun Heo <tj@kernel.org>2025-09-03 11:33:28 -1000
commitb7975c48695cdc2cc308df342f85ccaf9dac0888 (patch)
treed225a21e4e838bc08a1614c89971ca059b921bf6 /rust/helpers/rcu.c
parentde68c05189cc4508c3ac4e1e44da1ddb16b1bceb (diff)
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>
Diffstat (limited to 'rust/helpers/rcu.c')
0 files changed, 0 insertions, 0 deletions