[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250512151743.42988-1-arighi@nvidia.com>
Date: Mon, 12 May 2025 17:14:54 +0200
From: Andrea Righi <arighi@...dia.com>
To: Tejun Heo <tj@...nel.org>,
David Vernet <void@...ifault.com>,
Changwoo Min <changwoo@...lia.com>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH sched_ext/for-6.16 0/2] sched_ext: Extend usability of scx_bpf_select_cpu_and()
Many scx schedulers implement their own idle CPU selection policy, which
may be invoked from different contexts, not just from ops.select_cpu().
For example, some schedulers may need to trigger a proactive CPU wakeup
from ops.enqueue() after enqueuing a task, while others may expose this
functionality to user space, relying on a BPF test_run call to pick an idle
CPU.
To maintain a consistent selection policy, these schedulers often implement
their own idle CPU selection logic, since the built-in one is only usable
from ops.select_cpu(), leading to unnecessary code duplication and
fragmentation.
To address this, allow scx_bpf_select_cpu_and() to be used from any
context. This gives scx schedulers the option to use the built-in idle CPU
selection policy in a consistent way, potentially reducing code duplication
and fragmentation.
Andrea Righi (2):
sched_ext: Make scx_kf_allowed_if_unlocked() available outside ext.c
sched_ext/idle: Make scx_bpf_select_cpu_and() usable from any context
kernel/sched/ext.c | 5 -----
kernel/sched/ext.h | 5 +++++
kernel/sched/ext_idle.c | 23 +++++++++++++++++------
3 files changed, 22 insertions(+), 11 deletions(-)
Powered by blists - more mailing lists