Messages in this thread | ![/](/images/icornerl.gif) | | From | Valentin Schneider <> | Subject | Re: [RESEND][PATCH v9 4/7] sched: Add do_push_task helper | Date | Tue, 09 Apr 2024 18:29:57 +0200 |
| |
On 01/04/24 16:44, John Stultz wrote: > From: Connor O'Brien <connoro@google.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. > > Cc: Joel Fernandes <joelaf@google.com> > Cc: Qais Yousef <qyousef@google.com> > Cc: Ingo Molnar <mingo@redhat.com> > Cc: Peter Zijlstra <peterz@infradead.org> > Cc: Juri Lelli <juri.lelli@redhat.com> > Cc: Vincent Guittot <vincent.guittot@linaro.org> > Cc: Dietmar Eggemann <dietmar.eggemann@arm.com> > Cc: Valentin Schneider <vschneid@redhat.com> > Cc: Steven Rostedt <rostedt@goodmis.org> > Cc: Ben Segall <bsegall@google.com> > Cc: Zimuzo Ezeozue <zezeozue@google.com> > Cc: Youssef Esmat <youssefesmat@google.com> > Cc: Mel Gorman <mgorman@suse.de> > Cc: Daniel Bristot de Oliveira <bristot@redhat.com> > Cc: Will Deacon <will@kernel.org> > Cc: Waiman Long <longman@redhat.com> > Cc: Boqun Feng <boqun.feng@gmail.com> > Cc: "Paul E. McKenney" <paulmck@kernel.org> > Cc: Metin Kaya <Metin.Kaya@arm.com> > Cc: Xuewen Yan <xuewen.yan94@gmail.com> > Cc: K Prateek Nayak <kprateek.nayak@amd.com> > Cc: Thomas Gleixner <tglx@linutronix.de> > Cc: kernel-team@android.com > Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Naming nit below notwithstanding:
Reviewed-by: Valentin Schneider <vschneid@redhat.com>
> Signed-off-by: Connor O'Brien <connoro@google.com> > [jstultz: split out from larger chain migration patch] > Signed-off-by: John Stultz <jstultz@google.com>
> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h > index d2242679239e..16057de24ecd 100644 > --- a/kernel/sched/sched.h > +++ b/kernel/sched/sched.h > @@ -3472,5 +3472,14 @@ 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 do_push_task(struct rq *rq, struct rq *dst_rq, struct task_struct *task)
The naming IMO unfortunately clashes with the hotplug push_task / balance_push() stuff.
AFAICT this is move_queued_task() but in a double rq lock context. How about move_queued_task_locked()?
Interestingly, all the patched call sites end up with a resched_curr(), but move_queued_task() has wakeup_preempt() instead.
> +{ > + deactivate_task(rq, task, 0); > + set_task_cpu(task, dst_rq->cpu); > + activate_task(dst_rq, task, 0); > +} > +#endif > > #endif /* _KERNEL_SCHED_SCHED_H */ > -- > 2.44.0.478.gd926399ef9-goog
| ![\](/images/icornerr.gif) |