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

From: Schspa Shi
Date: Wed Jul 13 2022 - 08:24:45 EST


Dietmar Eggemann <dietmar.eggemann@xxxxxxx> writes:

> 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)`?

Thanks for the review, I missed this.

>
>> + 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?

OK, push_dl_task() needs this too, I missed it.

I will upload a new patch version to fix it.


--
BRs
Schspa Shi