Re: [PATCH 9/9] sched: Add pick_task(.core)

From: Juri Lelli
Date: Wed Aug 14 2024 - 06:42:58 EST


Hi Peter,

On 14/08/24 00:25, Peter Zijlstra wrote:
> In order to distinguish between a regular vs a core pick_task()
> invocation, add a boolean argument.
>
> Notably SCX seems to need this, since its core pick
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> ---

...

> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -2409,7 +2409,7 @@ static struct sched_dl_entity *pick_next
> * __pick_next_task_dl - Helper to pick the next -deadline task to run.

Super minor thing, but the above comment becomes stale after this and
previous changes.

> * @rq: The runqueue to pick the next task from.
> */
> -static struct task_struct *__pick_task_dl(struct rq *rq)
> +static struct task_struct *pick_task_dl(struct rq *rq, bool core)
> {
> struct sched_dl_entity *dl_se;
> struct dl_rq *dl_rq = &rq->dl;
> @@ -2423,7 +2423,7 @@ static struct task_struct *__pick_task_d
> WARN_ON_ONCE(!dl_se);
>
> if (dl_server(dl_se)) {
> - p = dl_se->server_pick_task(dl_se);
> + p = dl_se->server_pick_task(dl_se, core);
> if (!p) {
> dl_se->dl_yielded = 1;
> update_curr_dl_se(rq, dl_se, 0);
> @@ -2437,11 +2437,6 @@ static struct task_struct *__pick_task_d
> return p;
> }
>
> -static struct task_struct *pick_task_dl(struct rq *rq)
> -{
> - return __pick_task_dl(rq);
> -}
> -

Best,
Juri