lkml.org 
[lkml]   [2022]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v7 1/2] sched/rt: fix bad task migration for rt tasks
Date

Dietmar Eggemann <dietmar.eggemann@arm.com> writes:

> On 13/07/2022 15:48, Schspa Shi wrote:
>> Commit 95158a89dd50 ("sched,rt: Use the full cpumask for balancing")
>> allow find_lock_lowest_rq to pick a task with migration disabled.
>> This commit is intended to push the current running task on this CPU
>> away.
>>
>> There is a race scenario, which allows a migration disabled task to
>> be migrated to another CPU.
>>
>> When there is a RT task with higher priority, rt sched class was
>> intended to migrate higher priority task to lowest rq via push_rt_tasks,
>> this BUG will happen here.
> ^^^
>
> You mean the warning in set_task_cpu()?
>

Yes, this is the warning in set_task_cpu()?

void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
{
#ifdef CONFIG_SCHED_DEBUG
...
WARN_ON_ONCE(is_migration_disabled(p));
#endif
...
}

>> With the system running on PREEMPT_RT, rt_spin_lock will disable
>> migration, this will make the problem easier to reproduce.
>>
>> I have seen this crash on PREEMPT_RT, from the logs, there is a race
> ^^^^^
> ?
>
> We still talking about the set_task_cpu() warning, right?
>

Yes.

> [...]
>
> Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
>
> You should carry the Reviewed-by:'s you got in previous versions.

Thanks for the reminder, I'll pay attention to this next time.

I will upload a new patch version to carry it. and change the BUG in
comment message to WARN.

--
BRs
Schspa Shi

\
 
 \ /
  Last update: 2022-08-28 21:56    [W:0.054 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site