diff options
author | Peter Zijlstra <peterz@infradead.org> | 2017-12-21 10:01:24 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-03-09 07:59:16 +0100 |
commit | a22e47a4e3f5a9e50a827c5d94705ace3b1eac0b (patch) | |
tree | 907cfb61b5233db6935d234e9de615796d137acf /kernel/sched/sched.h | |
parent | 8f111bc357aa811e0bb5fdfe34c4c9efdafc15b9 (diff) | |
download | linux-a22e47a4e3f5a9e50a827c5d94705ace3b1eac0b.tar.bz2 |
sched/core: Convert nohz_flags to atomic_t
Using atomic_t allows us to use the more flexible bitops provided
there. Also its smaller.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/sched.h')
-rw-r--r-- | kernel/sched/sched.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 23ba4dd76ac4..d98e761b962f 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -763,7 +763,7 @@ struct rq { #ifdef CONFIG_SMP unsigned long last_load_update_tick; #endif /* CONFIG_SMP */ - unsigned long nohz_flags; + atomic_t nohz_flags; #endif /* CONFIG_NO_HZ_COMMON */ /* capture load from *all* tasks on this CPU: */ @@ -2034,10 +2034,11 @@ extern void cfs_bandwidth_usage_inc(void); extern void cfs_bandwidth_usage_dec(void); #ifdef CONFIG_NO_HZ_COMMON -enum rq_nohz_flag_bits { - NOHZ_TICK_STOPPED, - NOHZ_BALANCE_KICK, -}; +#define NOHZ_TICK_STOPPED_BIT 0 +#define NOHZ_BALANCE_KICK_BIT 1 + +#define NOHZ_TICK_STOPPED BIT(NOHZ_TICK_STOPPED_BIT) +#define NOHZ_BALANCE_KICK BIT(NOHZ_BALANCE_KICK_BIT) #define nohz_flags(cpu) (&cpu_rq(cpu)->nohz_flags) |