diff options
author | Holger Hoffstätte <holger@applied-asynchrony.com> | 2016-10-17 15:46:21 +0200 |
---|---|---|
committer | Holger Hoffstätte <holger@applied-asynchrony.com> | 2016-10-17 15:46:21 +0200 |
commit | 1b7e569d0de97217662df396b005f6fd57ee5ef8 (patch) | |
tree | 483ffcf4b70f4f7ffdfcb18ed926d1653558a52e /kernel/sched | |
parent | 75f10f028f79b12e1d40634edc54c505a9ee14e4 (diff) |
muqss: add cacheline alignment to global_rq counters
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/MuQSS.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/kernel/sched/MuQSS.c b/kernel/sched/MuQSS.c index 1700be5d25e2..62d94509fa4b 100644 --- a/kernel/sched/MuQSS.c +++ b/kernel/sched/MuQSS.c @@ -175,10 +175,17 @@ static inline int timeslice(void) * variables and a cpu bitmap set atomically. */ struct global_rq { - atomic_t nr_running; - atomic_t nr_uninterruptible; - atomic64_t nr_switches; - atomic_t qnr; /* queued not running */ +#ifdef CONFIG_SMP + atomic_t nr_running ____cacheline_aligned_in_smp; + atomic_t nr_uninterruptible ____cacheline_aligned_in_smp; + atomic64_t nr_switches ____cacheline_aligned_in_smp; + atomic_t qnr ____cacheline_aligned_in_smp; /* queued not running */ +#else + atomic_t nr_running ____cacheline_aligned; + atomic_t nr_uninterruptible ____cacheline_aligned; + atomic64_t nr_switches ____cacheline_aligned; + atomic_t qnr ____cacheline_aligned; /* queued not running */ +#endif #ifdef CONFIG_SMP cpumask_t cpu_idle_map; #endif @@ -217,7 +224,11 @@ static struct root_domain def_root_domain; #endif /* CONFIG_SMP */ /* There can be only one */ -static struct global_rq grq; +#ifdef CONFIG_SMP +static struct global_rq grq ____cacheline_aligned_in_smp; +#else +static struct global_rq grq ____cacheline_aligned; +#endif static DEFINE_MUTEX(sched_hotcpu_mutex); |