[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANDhNCocJCShaAOzd1sU+O+B3wd+YjXSddcGr2pESx9nfCdH4w@mail.gmail.com>
Date: Tue, 4 Jun 2024 08:53:22 -0700
From: John Stultz <jstultz@...gle.com>
To: Qais Yousef <qyousef@...alina.io>
Cc: LKML <linux-kernel@...r.kernel.org>, Joel Fernandes <joelaf@...gle.com>,
Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>, Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>, Valentin Schneider <vschneid@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>,
Zimuzo Ezeozue <zezeozue@...gle.com>, Youssef Esmat <youssefesmat@...gle.com>,
Mel Gorman <mgorman@...e.de>, Daniel Bristot de Oliveira <bristot@...hat.com>, Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>, Boqun Feng <boqun.feng@...il.com>,
"Paul E. McKenney" <paulmck@...nel.org>, Metin Kaya <Metin.Kaya@....com>,
Xuewen Yan <xuewen.yan94@...il.com>, K Prateek Nayak <kprateek.nayak@....com>,
Thomas Gleixner <tglx@...utronix.de>, kernel-team@...roid.com
Subject: Re: [PATCH v10 4/7] sched: Add move_queued_task_locked helper
On Tue, Jun 4, 2024 at 6:12 AM Qais Yousef <qyousef@...alina.io> wrote:
> On 05/06/24 21:54, John Stultz wrote:
> > From: Connor O'Brien <connoro@...gle.com>
> >
> > Switch logic that deactivates, sets the task cpu,
> > and reactivates a task on a different rq to use a
> > helper that will be later extended to push entire
> > blocked task chains.
> >
> > This patch was broken out from a larger chain migration
> > patch originally by Connor O'Brien.
...
> > diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> > index ae50f212775e..2d41ebe200c7 100644
> > --- a/kernel/sched/sched.h
> > +++ b/kernel/sched/sched.h
> > @@ -3480,5 +3480,16 @@ static inline void init_sched_mm_cid(struct task_struct *t) { }
> >
> > extern u64 avg_vruntime(struct cfs_rq *cfs_rq);
> > extern int entity_eligible(struct cfs_rq *cfs_rq, struct sched_entity *se);
> > +#ifdef CONFIG_SMP
> > +static inline
> > +void move_queued_task_locked(struct rq *rq, struct rq *dst_rq, struct task_struct *task)
> > +{
> > + lockdep_assert_rq_held(rq);
> > + lockdep_assert_rq_held(dst_rq);
> > + deactivate_task(rq, task, 0);
> > + set_task_cpu(task, dst_rq->cpu);
> > + activate_task(dst_rq, task, 0);
> > +}
> > +#endif
>
> I see this pattern in __migrate_swap_task() and try_steal_cookie(), should they
> be converted to?
Ah! Thanks for pointing it out. I'll include that in the next iteration.
> Beside this
>
> Reviewed-by: Qais Yousef <qyousef@...alina.io>
Thank you so much for the review and feedback!
-john
Powered by blists - more mailing lists