[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171220150502.nyjrbvwgbh56bgbs@hirez.programming.kicks-ass.net>
Date: Wed, 20 Dec 2017 16:05:02 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Vincent Guittot <vincent.guittot@...aro.org>
Cc: Brendan Jackman <brendan.jackman@....com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Ingo Molnar <mingo@...nel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>,
Morten Rasmussen <morten.rasmussen@....com>
Subject: Re: [PATCH v2 1/2] sched: force update of blocked load of idle cpus
On Wed, Dec 20, 2017 at 04:01:10PM +0100, Peter Zijlstra wrote:
> Well, you shouldn't mix atomic and non-atomic ops to the same word,
> that's asking for trouble.
>
> But why don't you do something like:
>
> nohz_kick()
>
> flags = NOHZ_STAT;
> if (!only_update)
> flags |= NOHZ_BALANCE;
>
> atomic_long_or(flags, &nohz_cpu(cpu));
>
>
> nohz_idle_balance()
>
> unsigned long do_flags = atomic_long_fetch_andnot(NOHZ_BALANCE|NOHZ_STAT, &nohz_flags(cpu));
>
> if (do_flags & NOHZ_STAT)
> update_blocked_stuff();
>
> if (do_flags & NOHZ_BALANCE)
> rebalance_domains();
>
> That way its far more readable.
we could use atomic_t too, there's not that many flags in there, the
only reason its long is because of that bitmap crud.
Powered by blists - more mailing lists