Skip to content

Commit 5873b8a

Browse files
committed
rcu-tasks: Refactor RCU-tasks to allow variants to be added
This commit splits out generic processing from RCU-tasks-specific processing in order to allow additional flavors to be added. It also adds a def_bool TASKS_RCU_GENERIC to enable the common RCU-tasks infrastructure code. This is primarily, but not entirely, a code-movement commit. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 9cf8fc6 commit 5873b8a

File tree

4 files changed

+272
-239
lines changed

4 files changed

+272
-239
lines changed

include/linux/rcupdate.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static inline void rcu_init_nohz(void) { }
129129
* Note a quasi-voluntary context switch for RCU-tasks's benefit.
130130
* This is a macro rather than an inline function to avoid #include hell.
131131
*/
132-
#ifdef CONFIG_TASKS_RCU
132+
#ifdef CONFIG_TASKS_RCU_GENERIC
133133
#define rcu_tasks_qs(t) \
134134
do { \
135135
if (READ_ONCE((t)->rcu_tasks_holdout)) \
@@ -140,14 +140,14 @@ void call_rcu_tasks(struct rcu_head *head, rcu_callback_t func);
140140
void synchronize_rcu_tasks(void);
141141
void exit_tasks_rcu_start(void);
142142
void exit_tasks_rcu_finish(void);
143-
#else /* #ifdef CONFIG_TASKS_RCU */
143+
#else /* #ifdef CONFIG_TASKS_RCU_GENERIC */
144144
#define rcu_tasks_qs(t) do { } while (0)
145145
#define rcu_note_voluntary_context_switch(t) do { } while (0)
146146
#define call_rcu_tasks call_rcu
147147
#define synchronize_rcu_tasks synchronize_rcu
148148
static inline void exit_tasks_rcu_start(void) { }
149149
static inline void exit_tasks_rcu_finish(void) { }
150-
#endif /* #else #ifdef CONFIG_TASKS_RCU */
150+
#endif /* #else #ifdef CONFIG_TASKS_RCU_GENERIC */
151151

152152
/**
153153
* cond_resched_tasks_rcu_qs - Report potential quiescent states to RCU

kernel/rcu/Kconfig

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,19 @@ config TREE_SRCU
7070
help
7171
This option selects the full-fledged version of SRCU.
7272

73+
config TASKS_RCU_GENERIC
74+
def_bool TASKS_RCU
75+
select SRCU
76+
help
77+
This option enables generic infrastructure code supporting
78+
task-based RCU implementations. Not for manual selection.
79+
7380
config TASKS_RCU
7481
def_bool PREEMPTION
75-
select SRCU
7682
help
7783
This option enables a task-based RCU implementation that uses
7884
only voluntary context switch (not preemption!), idle, and
79-
user-mode execution as quiescent states.
85+
user-mode execution as quiescent states. Not for manual selection.
8086

8187
config RCU_STALL_COMMON
8288
def_bool TREE_RCU

0 commit comments

Comments
 (0)