Re: [PATCH v2] sched_ext: Trigger ops.update_idle() from pick_task_idle()

Tejun Heo
2024-10-15T01:12:17Z

Hello,

On Tue, Oct 15, 2024 at 12:06:03AM +0200, Andrea Righi wrote:
> @@ -459,13 +459,13 @@ static void put_prev_task_idle(struct rq *rq, struct task_struct *prev, struct t
> static void set_next_task_idle(struct rq *rq, struct task_struct *next, bool first)
> {
> update_idle_core(rq);
> - scx_update_idle(rq, true);
> schedstat_inc(rq->sched_goidle);
> next->se.exec_start = rq_clock_task(rq);
> }
>
> struct task_struct *pick_task_idle(struct rq *rq)
> {
> + scx_update_idle(rq, true);

Thanks a lot for debugging this. Both the analysis and solution make sense
to me. However, as this puts scx_update_idle() in a different place from
other idle handling functions, can you please add a comment explaining why
it needs to be in pick_task_idle() instead of set_next_task_idle()?

Thanks.

--
tejun