Re: [PATCH v6 2/2] sched/rt: Trying to push current task when target disable migrating

Dietmar Eggemann
2022-07-13T10:02:59Z

On 12/07/2022 17:05, Schspa Shi wrote:

[...]

> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index 7bd3e6ecbe45e..e2d7b085a93d9 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -2136,6 +2136,12 @@ static int push_rt_task(struct rq *rq, bool pull)
> */
> task = pick_next_pushable_task(rq);
> if (task == next_task) {
> + /*
> + * If next task has now disabled migrating, see if we
> + * can push the current task.
> + */
> + if (unlikely(is_migration_disabled(task)))

Doesn't this need a `put_task_struct(next_task)`?

> + goto retry;
> /*
> * The task hasn't migrated, and is still the next
> * eligible task, but we failed to find a run-queue

Why not introduce in push_dl_task() as well?