[PATCH] sched_ext: Clarify ops.select_cpu() for single-CPU tasks

Andrea Righi posted 1 patch 1 month ago
kernel/sched/ext.c | 5 +++++
1 file changed, 5 insertions(+)
[PATCH] sched_ext: Clarify ops.select_cpu() for single-CPU tasks
Posted by Andrea Righi 1 month ago
Update ops.select_cpu() documentation to clarify that this method is not
called for tasks that are restricted to run on a single CPU, as these
tasks do not have the option to select a different CPU.

Signed-off-by: Andrea Righi <arighi@nvidia.com>
---
 kernel/sched/ext.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 145677c6159c..b948fd96c29a 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -222,6 +222,11 @@ struct sched_ext_ops {
 	 * is dispatched, the ops.enqueue() callback will be skipped. Finally,
 	 * if @p is dispatched to SCX_DSQ_LOCAL, it will be dispatched to the
 	 * local DSQ of whatever CPU is returned by this callback.
+	 *
+	 * Note that select_cpu() is never called for tasks that can only run
+	 * on a single CPU or tasks with migration disabled, as they don't have
+	 * the option to select a different CPU. See select_task_rq() for
+	 * details.
 	 */
 	s32 (*select_cpu)(struct task_struct *p, s32 prev_cpu, u64 wake_flags);
 
-- 
2.47.0
Re: [PATCH] sched_ext: Clarify ops.select_cpu() for single-CPU tasks
Posted by Tejun Heo 1 month ago
On Wed, Oct 23, 2024 at 01:19:07PM +0200, Andrea Righi wrote:
> Update ops.select_cpu() documentation to clarify that this method is not
> called for tasks that are restricted to run on a single CPU, as these
> tasks do not have the option to select a different CPU.
> 
> Signed-off-by: Andrea Righi <arighi@nvidia.com>

Applied to sched_ext/for-6.13.

Thanks.

-- 
tejun