[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230711161926.GA389526@maniforge>
Date: Tue, 11 Jul 2023 11:19:26 -0500
From: David Vernet <void@...ifault.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, mingo@...hat.com,
juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, bristot@...hat.com, vschneid@...hat.com,
gautham.shenoy@....com, kprateek.nayak@....com, aaron.lu@...el.com,
clm@...a.com, tj@...nel.org, roman.gushchin@...ux.dev,
kernel-team@...a.com
Subject: Re: [PATCH v2 4/7] sched/fair: Add SHARED_RUNQ sched feature and
skeleton calls
On Tue, Jul 11, 2023 at 11:45:47AM +0200, Peter Zijlstra wrote:
> On Mon, Jul 10, 2023 at 03:03:39PM -0500, David Vernet wrote:
>
> > @@ -11843,6 +11871,9 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf)
> > if (!cpu_active(this_cpu))
> > return 0;
> >
> > + if (sched_feat(SHARED_RUNQ) && shared_runq_pick_next_task(this_rq, rf))
> > + return -1;
> > +
>
> Next patch implements shared_runq_pick_next_task() with the same return
> values as newidle_balance(), which would seem to suggest the following
> instead:
>
> if (sched_feat(SHARED_RUNQ)) {
> pulled_task = shared_runq_pick_next_task(this_rq, rf);
> if (pulled_task)
> return pulled_task;
> }
Yep, that's cleaner.
> Additionally, I think we wants something like:
>
> sd = rcu_dereference_check_sched_domain(this_rq->sd);
> if (sched_feat(SHARED_RUNQ)) {
> ... /* see above */
>
> sd = rcu_dereference(*this_cpu_ptr(&sd_llc));
> sd = sd->parent;
> }
>
> to ensure we skip <=LLC domains, since those have already been covered
> by this shiny new thing, no?
Indeed, another nice optimization. I'll incorporate both of these into
the next version.
Powered by blists - more mailing lists