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

\
 
 \ /
  Last update: 2017-12-20 16:05    [W:0.054 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site