lkml.org 
[lkml]   [2020]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2020-10-06 09:26    [W:0.333 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site