Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rcu: Move RCU_BOOST variable declarations, eliminating #ifdef

There are some RCU_BOOST-specific per-CPU variable declarations that
are needlessly defined under #ifdef in kernel/rcu/tree.c. This commit
therefore moves these declarations into a pre-existing #ifdef in
kernel/rcu/tree_plugin.h.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

+15 -15
-13
kernel/rcu/tree.c
··· 152 152 */ 153 153 static int rcu_scheduler_fully_active __read_mostly; 154 154 155 - #ifdef CONFIG_RCU_BOOST 156 - 157 - /* 158 - * Control variables for per-CPU and per-rcu_node kthreads. These 159 - * handle all flavors of RCU. 160 - */ 161 - static DEFINE_PER_CPU(struct task_struct *, rcu_cpu_kthread_task); 162 - DEFINE_PER_CPU(unsigned int, rcu_cpu_kthread_status); 163 - DEFINE_PER_CPU(unsigned int, rcu_cpu_kthread_loops); 164 - DEFINE_PER_CPU(char, rcu_cpu_has_work); 165 - 166 - #endif /* #ifdef CONFIG_RCU_BOOST */ 167 - 168 155 static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu); 169 156 static void invoke_rcu_core(void); 170 157 static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp);
+15 -2
kernel/rcu/tree_plugin.h
··· 33 33 #define RCU_KTHREAD_PRIO 1 34 34 35 35 #ifdef CONFIG_RCU_BOOST 36 + 36 37 #include "../locking/rtmutex_common.h" 37 38 #define RCU_BOOST_PRIO CONFIG_RCU_BOOST_PRIO 38 - #else 39 + 40 + /* 41 + * Control variables for per-CPU and per-rcu_node kthreads. These 42 + * handle all flavors of RCU. 43 + */ 44 + static DEFINE_PER_CPU(struct task_struct *, rcu_cpu_kthread_task); 45 + DEFINE_PER_CPU(unsigned int, rcu_cpu_kthread_status); 46 + DEFINE_PER_CPU(unsigned int, rcu_cpu_kthread_loops); 47 + DEFINE_PER_CPU(char, rcu_cpu_has_work); 48 + 49 + #else /* #ifdef CONFIG_RCU_BOOST */ 50 + 39 51 #define RCU_BOOST_PRIO RCU_KTHREAD_PRIO 40 - #endif 52 + 53 + #endif /* #else #ifdef CONFIG_RCU_BOOST */ 41 54 42 55 #ifdef CONFIG_RCU_NOCB_CPU 43 56 static cpumask_var_t rcu_nocb_mask; /* CPUs to have callbacks offloaded. */