[PATCH v3] Implement SCX_OPS_TRACK_MIGRATION
From: Henry Huang
Date: Mon Jun 23 2025 - 02:30:53 EST
In our environment, we need track task migrations to update per-cpu
map.
Implementing fentry(on enqueue_task_scx & dequeue_task_scx)
is a feasible solution. But there are some limitations:
1. Can't modify p->scx.xxx
2. enqueue_task_scx & dequeue_task_scx can't have some
special compilation optimizations.
3. Has more overhead compared to struct_ops
So we introduce SCX_OPS_TRACK_MIGRATION to support tracking task
migrations.
If SCX_OPS_TRACK_MIGRATION is set, runnable/quiescent
would be called whether task is doing migration or not.
For v2:
1. if task_on_rq_migrating(p) == true
set DEQUEUE_MIGRATING to deq_flags in dequeue_task_scx
set ENQUEUE_MIGRATING to enq_flags in enqueue_task_scx
For v3:
1. introduce SCX_ENQ_MIGRATING(=ENQUEUE_MIGRATING),
SCX_DEQ_MIGRATING(DEQUEUE_MIGRATING)
2. change patch title:
include SCX_OPS_TRACK_MIGRATION --> Implement SCX_OPS_TRACK_MIGRATION
Henry Huang (1):
sched_ext: Implement SCX_OPS_TRACK_MIGRATION
kernel/sched/ext.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
--
Henry