[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201006072540.GK2628@hirez.programming.kicks-ass.net>
Date: Tue, 6 Oct 2020 09:25:40 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: tglx@...utronix.de, mingo@...nel.org
Cc: linux-kernel@...r.kernel.org, bigeasy@...utronix.de,
qais.yousef@....com, swood@...hat.com, valentin.schneider@....com,
juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, bristot@...hat.com, vincent.donnefort@....com,
tj@...nel.org
Subject: Re: [PATCH -v2 03/17] sched/hotplug: Ensure only per-cpu kthreads
run during hotplug
On Mon, Oct 05, 2020 at 04:57:20PM +0200, Peter Zijlstra wrote:
> +static inline void balance_switch(struct rq *rq)
> +{
> + if (unlikely(rq->balance_flags)) {
> + /*
> + * Run the balance_callbacks, except on hotplug
> + * when we need to push the current task away.
> + */
> + if (!IS_ENABLED(CONFIG_HOTPLUG_CPU) ||
> + !(rq->balance_flags & BALANCE_PUSH) ||
> + !balance_push(rq))
> + __balance_callbacks(rq);
> + }
> +}
> @@ -1392,12 +1396,13 @@ queue_balance_callback(struct rq *rq,
> {
> lockdep_assert_held(&rq->lock);
>
> - if (unlikely(head->next))
> + if (unlikely(head->next || (rq->balance_flags & BALANCE_PUSH)))
> return;
With this bit from Valentin we can probably simplify the above function,
but I've not thought about that yet.
Powered by blists - more mailing lists