lkml.org 
[lkml]   [2022]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] sched: fix bad task migration for rt tasks
Valentin Schneider <vschneid@redhat.com> writes:

> On 24/06/22 02:29, Schspa Shi wrote:
>> @@ -1998,12 +1998,15 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq)
>> * the mean time, task could have
>> * migrated already or had its affinity changed.
>> * Also make sure that it wasn't scheduled on its rq.
>> + * It is possible the task has running for a while,
>> + * And we check task migration disable flag again.
>> */
>> if (unlikely(task_rq(task) != rq ||
>> !cpumask_test_cpu(lowest_rq->cpu, &task->cpus_mask) ||
>
> cf. 95158a89dd50 ("sched,rt: Use the full cpumask for balancing"), this
> made sense to me back then but not so much anymore... Shouldn't this have
> remained a ->cpus_ptr check?
>

This cpus_ptr check seems to be somehow same with is_migration_disabled(task).

> I'm going to revisit that commit, I evicted too much of it.
>

Any further progress on this?

We have tested this patch for a weak, It seems the problems have gone
(It will reproduce 2-3 times per week usually).

I have send a V2 patch too, it task the other case into consideration
(Going to retry to push the current running task on this CPU away,
instead doing nothing for this migrate disabled task.).

Link: https://lore.kernel.org/all/20220627154051.92599-1-schspa@gmail.com/


>> task_running(rq, task) ||
>> !rt_task(task) ||
>> - !task_on_rq_queued(task))) {
>> + !task_on_rq_queued(task) ||
>> + is_migration_disabled(task))) {
>>
>> double_unlock_balance(rq, lowest_rq);
>> lowest_rq = NULL;
>> --
>> 2.24.3 (Apple Git-128)

--
Schspa Shi
BRs

\
 
 \ /
  Last update: 2022-07-01 09:17    [W:0.062 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site