linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: Jing-Ting Wu <jing-ting.wu@mediatek.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Waiman Long <longman@redhat.com>
Subject: Re: BUG: HANG_DETECT waiting for migration_cpu_stop() complete
Date: Wed,  7 Sep 2022 08:07:41 +0800	[thread overview]
Message-ID: <20220907000741.2496-1-hdanton@sina.com> (raw)
In-Reply-To: <88b2910181bda955ac46011b695c53f7da39ac47.camel@mediatek.com>

On 5 Sep 2022 10:47:36 +0800 Jing-Ting Wu <jing-ting.wu@mediatek.com> wrote
> 
> We meet the HANG_DETECT happened in T SW version with kernel-5.15.
> Many tasks have been blocked for a long time.
> 
> Root cause:
> migration_cpu_stop() is not complete due to is_migration_disabled(p) is
> true, complete is false and complete_all() never get executed.
> It let other task wait the rwsem.

See if handing task over to stopper again in case of migration disabled
could survive your tests.

Hillf

--- linux-5.15/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2322,9 +2322,7 @@ static int migration_cpu_stop(void *data
 	 * holding rq->lock, if p->on_rq == 0 it cannot get enqueued because
 	 * we're holding p->pi_lock.
 	 */
-	if (task_rq(p) == rq) {
-		if (is_migration_disabled(p))
-			goto out;
+	if (task_rq(p) == rq && !is_migration_disabled(p)) {
 
 		if (pending) {
 			p->migration_pending = NULL;


       reply	other threads:[~2022-09-07  0:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <88b2910181bda955ac46011b695c53f7da39ac47.camel@mediatek.com>
2022-09-07  0:07 ` Hillf Danton [this message]
2022-09-22  5:40   ` Jing-Ting Wu
2022-09-22 12:02     ` Hillf Danton

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=20220907000741.2496-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=jing-ting.wu@mediatek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=longman@redhat.com \
    --cc=peterz@infradead.org \
    /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