mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 15:22:21 -04:00
sched_ext: scx_qmap - Idle-check pinned tasks before direct dispatch
pick_direct_dispatch_cid() sent a pinned task straight to its only cpu without an idle check. An insert onto a time-shared cid is forced IMMED, which may not wait on a busy cpu - the kernel bounces the task back to ops.enqueue(), the shortcut re-inserts it, and the loop runs into the reenqueue repeat limit. Run pinned tasks through the same idle test as everyone else and queue them when the cpu is busy. always_enq_immed forces IMMED on every local insert and already skipped the shortcut for the same reason. The check was the last reader of the always_enq_immed rodata mirror, so drop the variable. The -I option still sets SCX_OPS_ALWAYS_ENQ_IMMED. v2: Drop the now-unread always_enq_immed rodata mirror. (sashiko AI) Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Andrea Righi <arighi@nvidia.com>
This commit is contained in:
@@ -66,7 +66,6 @@ const volatile bool print_msgs;
|
||||
const volatile u64 sub_cgroup_id;
|
||||
const volatile s32 disallow_tgid;
|
||||
const volatile bool suppress_dump;
|
||||
const volatile bool always_enq_immed;
|
||||
const volatile u32 immed_stress_nth;
|
||||
const volatile u32 max_tasks;
|
||||
|
||||
@@ -230,9 +229,6 @@ static s32 pick_direct_dispatch_cid(struct task_struct *p, s32 prev_cid,
|
||||
s32 cid;
|
||||
u32 i;
|
||||
|
||||
if (!always_enq_immed && p->nr_cpus_allowed == 1)
|
||||
return prev_cid;
|
||||
|
||||
if (cmask_test(prev_cid, &qa.self_cids.mask) &&
|
||||
cmask_test_and_clear(prev_cid, &qa.idle_cids.mask))
|
||||
return prev_cid;
|
||||
|
||||
@@ -315,7 +315,6 @@ int main(int argc, char **argv)
|
||||
skel->struct_ops.qmap_ops->flags |= SCX_OPS_SWITCH_PARTIAL;
|
||||
break;
|
||||
case 'I':
|
||||
skel->rodata->always_enq_immed = true;
|
||||
skel->struct_ops.qmap_ops->flags |= SCX_OPS_ALWAYS_ENQ_IMMED;
|
||||
break;
|
||||
case 'F':
|
||||
|
||||
Reference in New Issue
Block a user