public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Schspa Shi <schspa@gmail.com>
To: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de, bristot@redhat.com,
	vschneid@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 1/2] sched/rt: fix bad task migration for rt tasks
Date: Sun, 28 Aug 2022 23:45:38 +0800	[thread overview]
Message-ID: <m24jxwnz6u.fsf@gmail.com> (raw)
In-Reply-To: <43de1f15-42cf-45ea-db5c-30de976a6828@arm.com>


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

      reply	other threads:[~2022-08-28 15:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13 13:48 [PATCH v7 1/2] sched/rt: fix bad task migration for rt tasks Schspa Shi
2022-07-13 13:48 ` [PATCH v7 2/2] sched/rt: Trying to push current task when target disable migrating Schspa Shi
2022-08-26 18:46   ` Dietmar Eggemann
2022-08-28 15:54     ` Schspa Shi
2022-08-24  6:04 ` [PATCH v7 1/2] sched/rt: fix bad task migration for rt tasks Schspa Shi
2022-08-26 18:45 ` Dietmar Eggemann
2022-08-28 15:45   ` Schspa Shi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m24jxwnz6u.fsf@gmail.com \
    --to=schspa@gmail.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox