Skip to content

Commit 61cfd09

Browse files
committed
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>
1 parent 4568779 commit 61cfd09

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎kernel/rcu/tree.c‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,6 @@ EXPORT_SYMBOL_GPL(rcu_scheduler_active);
152152
*/
153153
static int rcu_scheduler_fully_active __read_mostly;
154154

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-
168155
static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu);
169156
static void invoke_rcu_core(void);
170157
static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp);

‎kernel/rcu/tree_plugin.h‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,24 @@
3333
#define RCU_KTHREAD_PRIO 1
3434

3535
#ifdef CONFIG_RCU_BOOST
36+
3637
#include "../locking/rtmutex_common.h"
3738
#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+
3951
#define RCU_BOOST_PRIO RCU_KTHREAD_PRIO
40-
#endif
52+
53+
#endif /* #else #ifdef CONFIG_RCU_BOOST */
4154

4255
#ifdef CONFIG_RCU_NOCB_CPU
4356
static cpumask_var_t rcu_nocb_mask; /* CPUs to have callbacks offloaded. */

0 commit comments

Comments
 (0)