[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKfTPtBw81fGU21Y5C58SBdGkD0=SHFpRQw=yywK6Hf0gX4ohQ@mail.gmail.com>
Date: Mon, 16 Jun 2025 14:39:59 +0200
From: Vincent Guittot <vincent.guittot@...aro.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: mingo@...hat.com, juri.lelli@...hat.com, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de, vschneid@...hat.com,
clm@...a.com, linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 5/5] sched: Add ttwu_queue support for delayed tasks
On Wed, 11 Jun 2025 at 11:39, Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Fri, Jun 06, 2025 at 06:55:37PM +0200, Vincent Guittot wrote:
> > > > > @@ -3830,12 +3859,41 @@ void sched_ttwu_pending(void *arg)
> > > > > update_rq_clock(rq);
> > > > >
> > > > > llist_for_each_entry_safe(p, t, llist, wake_entry.llist) {
> > > > > + struct rq *p_rq = task_rq(p);
> > > > > + int ret;
> > > > > +
> > > > > + /*
> > > > > + * This is the ttwu_runnable() case. Notably it is possible for
> > > > > + * on-rq entities to get migrated -- even sched_delayed ones.
> > > >
> > > > I haven't found where the sched_delayed task could migrate on another cpu.
> > >
> > > Doesn't happen often, but it can happen. Nothing really stops it from
> > > happening. Eg weight based balancing can do it. As can numa balancing
> > > and affinity changes.
> >
> > Yes, I agree that delayed tasks can migrate because of load balancing
> > but not at wake up.
>
> Right, but this here is the case where wakeup races with load-balancing.
> Specifically, due to the wake_list, the wakeup can happen while the task
> is on CPU N, and by the time the IPI gets processed the task has moved
> to CPU M.
>
> It doesn't happen often, but it was 'fun' chasing that fail around for a
> day :/
Ok, it makes sense now.
Powered by blists - more mailing lists