From: albin_yang@163.com
To: kayracizmeci@gmail.com
Cc: albin_yang@163.com, albinwyang@tencent.com, bsegall@google.com,
dietmar.eggemann@arm.com, juri.lelli@redhat.com,
kprateek.nayak@amd.com, linux-kernel@vger.kernel.org,
mgorman@suse.de, mingo@redhat.com, peterz@infradead.org,
rostedt@goodmis.org, vincent.guittot@linaro.org,
vschneid@redhat.com
Subject: Re: [PATCH] sched/stats: Fix run_delay over-count for migrated sched_delayed tasks
Date: Sun, 20 Sep 2026 10:52:06 +0800 [thread overview]
Message-ID: <20260920025206.1237461-1-albin_yang@163.com> (raw)
In-Reply-To: <20260919102420.108000-1-kayracizmeci@gmail.com>
Hi Kayra,
On Sat, Sep 19, 2026 at 01:24:20PM +0300, Kayra Cizmeci wrote:
> No? can_migrate_task() skips delayed tasks unless they are both delayed and
> migration_type not equals migrate_load.
>
> And can_migrate_task() is called from detach_one_task() which
> gets called from active_load_balance_cpu_stop(), with a custom
> env where the migration type is not set. That means, the migration
> type is migrate_load, and can_migrate_task() can return 1 for delayed
> tasks on this path.
You are right, thanks for catching this.
migrate_load is 0, and active_load_balance_cpu_stop()'s lb_env does not
set .migration_type, so it stays 0 == migrate_load. Hence in
can_migrate_task():
if ((p->se.sched_delayed) && (env->migration_type != migrate_load))
return 0;
the condition is false on that path, and a sched_delayed task can indeed
be migrated.
It is also a bit broader than the active balance case: load_balance() ->
calculate_imbalance() sets env->migration_type = migrate_load for some
group types, so regular load balance can hit it too. Either way those
paths re-attach via attach_task() -> activate_task(rq, p, ENQUEUE_NOCLOCK),
again without ENQUEUE_RESTORE, so they hit the same bug.
So the "load-balance migrations are unaffected" part of my commit message
is wrong. The fix itself is unchanged and covers those paths as well; only
the description was wrong. I'll correct it in v2.
Thanks,
Wei Yang
prev parent reply other threads:[~2026-09-20 2:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 13:33 albin_yang
2026-09-19 3:59 ` albin_yang
2026-09-19 7:58 ` Chen Yu
2026-09-19 10:24 ` Kayra Cizmeci
2026-09-20 2:52 ` albin_yang [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=20260920025206.1237461-1-albin_yang@163.com \
--to=albin_yang@163.com \
--cc=albinwyang@tencent.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kayracizmeci@gmail.com \
--cc=kprateek.nayak@amd.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
all inboxes | Powered by JetHome®