mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>,
	Francesco Nigro <nigro.fra@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Valentin Schneider <vschneid@redhat.com>,
	Mike Galbraith <efault@gmx.de>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Huang Rui <ray.huang@amd.com>,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [REPORT] sched: ITMT + DELAY_DEQUEUE: woken task waits ~1 ms behind another task on the preferred CPU while allowed CPUs are idle
Date: Thu, 12 Nov 2026 10:36:13 +0100	[thread overview]
Message-ID: <20261112093613.GJ2668804@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKfTPtCGmZQ9XVYJL_5f603qTf6_CdeKsq_pAYM_Ldqs3NaXaA@mail.gmail.com>

On Thu, Nov 12, 2026 at 09:59:02AM +0100, Vincent Guittot wrote:

> If the root problem is the migration of a delayed task during
> newly_idle load balance which transiently make the CPU not idle
> anymore for another task waking up simultaenously, can't we just
> prevent migrating delayed task for newly_idle case in can_migrate ?
> Migrating a delayed task to a newly idle CPU doesn't really make sense
> because it will be the only task that will e migrated and will be
> immediatly dequeued.

In fact, I would suggest just dequeuing it right then and there. If it
were actually runnable, it would get to run on the new idle cpu.
Therefore it is not contended anymore and its lag can be dropped.

> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -11771,7 +11771,7 @@ int can_migrate_task(struct task_struct *p,
> struct lb_env *env)
>          * 5) are cache-hot on their current CPU, or
>          * 6) are blocked on mutexes (if SCHED_PROXY_EXEC is enabled)
>          */
> -       if ((p->se.sched_delayed) && (env->migration_type != migrate_load))
> +       if ((p->se.sched_delayed) && (env->idle == CPU_NEWLY_IDLE ||
> env->migration_type != migrate_load))
>                 return 0;
> 
>         if (lb_throttled_hierarchy(p, env->dst_cpu))



      reply	other threads:[~2026-11-12  9:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 15:46 Francesco Nigro
2026-11-03 17:27 ` Mike Galbraith
2026-11-03 23:33   ` Francesco Nigro
2026-11-04  3:13     ` Mike Galbraith
2026-11-04 22:06       ` Francesco Nigro
2026-11-05  4:11 ` K Prateek Nayak
2026-11-05  8:12   ` Francesco Nigro
2026-11-05  8:34     ` K Prateek Nayak
2026-11-11 16:03       ` Francesco Nigro
2026-11-12  8:59   ` Vincent Guittot
2026-11-12  9:36     ` Peter Zijlstra [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=20261112093613.GJ2668804@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=efault@gmx.de \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mingo@redhat.com \
    --cc=nigro.fra@gmail.com \
    --cc=ray.huang@amd.com \
    --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®