Skip to content

Commit 4dca1af

Browse files
terminusfbq
authored andcommitted
rcu: rename PREEMPT_AUTO to PREEMPT_LAZY
Replace mentions of PREEMPT_AUTO with PREEMPT_LAZY. Also, since PREMPT_LAZY implies PREEMPTION, we can reduce the TASKS_RCU selection criteria from this: NEED_TASKS_RCU && (PREEMPTION || PREEMPT_AUTO) to this: NEED_TASKS_RCU && PREEMPTION CC: Paul E. McKenney <paulmck@kernel.org> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
1 parent ad6b5b7 commit 4dca1af

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

include/linux/srcutiny.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static inline int __srcu_read_lock(struct srcu_struct *ssp)
6464
{
6565
int idx;
6666

67-
preempt_disable(); // Needed for PREEMPT_AUTO
67+
preempt_disable(); // Needed for PREEMPT_LAZY
6868
idx = ((READ_ONCE(ssp->srcu_idx) + 1) & 0x2) >> 1;
6969
WRITE_ONCE(ssp->srcu_lock_nesting[idx], READ_ONCE(ssp->srcu_lock_nesting[idx]) + 1);
7070
preempt_enable();

kernel/rcu/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ config NEED_TASKS_RCU
9191

9292
config TASKS_RCU
9393
bool
94-
default NEED_TASKS_RCU && (PREEMPTION || PREEMPT_AUTO)
94+
default NEED_TASKS_RCU && PREEMPTION
9595
select IRQ_WORK
9696

9797
config FORCE_TASKS_RUDE_RCU

kernel/rcu/srcutiny.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void __srcu_read_unlock(struct srcu_struct *ssp, int idx)
9898
{
9999
int newval;
100100

101-
preempt_disable(); // Needed for PREEMPT_AUTO
101+
preempt_disable(); // Needed for PREEMPT_LAZY
102102
newval = READ_ONCE(ssp->srcu_lock_nesting[idx]) - 1;
103103
WRITE_ONCE(ssp->srcu_lock_nesting[idx], newval);
104104
preempt_enable();
@@ -120,7 +120,7 @@ void srcu_drive_gp(struct work_struct *wp)
120120
struct srcu_struct *ssp;
121121

122122
ssp = container_of(wp, struct srcu_struct, srcu_work);
123-
preempt_disable(); // Needed for PREEMPT_AUTO
123+
preempt_disable(); // Needed for PREEMPT_LAZY
124124
if (ssp->srcu_gp_running || ULONG_CMP_GE(ssp->srcu_idx, READ_ONCE(ssp->srcu_idx_max))) {
125125
preempt_enable();
126126
return; /* Already running or nothing to do. */
@@ -138,7 +138,7 @@ void srcu_drive_gp(struct work_struct *wp)
138138
WRITE_ONCE(ssp->srcu_gp_waiting, true); /* srcu_read_unlock() wakes! */
139139
preempt_enable();
140140
swait_event_exclusive(ssp->srcu_wq, !READ_ONCE(ssp->srcu_lock_nesting[idx]));
141-
preempt_disable(); // Needed for PREEMPT_AUTO
141+
preempt_disable(); // Needed for PREEMPT_LAZY
142142
WRITE_ONCE(ssp->srcu_gp_waiting, false); /* srcu_read_unlock() cheap. */
143143
WRITE_ONCE(ssp->srcu_idx, ssp->srcu_idx + 1);
144144
preempt_enable();
@@ -159,7 +159,7 @@ void srcu_drive_gp(struct work_struct *wp)
159159
* at interrupt level, but the ->srcu_gp_running checks will
160160
* straighten that out.
161161
*/
162-
preempt_disable(); // Needed for PREEMPT_AUTO
162+
preempt_disable(); // Needed for PREEMPT_LAZY
163163
WRITE_ONCE(ssp->srcu_gp_running, false);
164164
idx = ULONG_CMP_LT(ssp->srcu_idx, READ_ONCE(ssp->srcu_idx_max));
165165
preempt_enable();
@@ -172,7 +172,7 @@ static void srcu_gp_start_if_needed(struct srcu_struct *ssp)
172172
{
173173
unsigned long cookie;
174174

175-
preempt_disable(); // Needed for PREEMPT_AUTO
175+
preempt_disable(); // Needed for PREEMPT_LAZY
176176
cookie = get_state_synchronize_srcu(ssp);
177177
if (ULONG_CMP_GE(READ_ONCE(ssp->srcu_idx_max), cookie)) {
178178
preempt_enable();
@@ -199,7 +199,7 @@ void call_srcu(struct srcu_struct *ssp, struct rcu_head *rhp,
199199

200200
rhp->func = func;
201201
rhp->next = NULL;
202-
preempt_disable(); // Needed for PREEMPT_AUTO
202+
preempt_disable(); // Needed for PREEMPT_LAZY
203203
local_irq_save(flags);
204204
*ssp->srcu_cb_tail = rhp;
205205
ssp->srcu_cb_tail = &rhp->next;
@@ -261,7 +261,7 @@ unsigned long start_poll_synchronize_srcu(struct srcu_struct *ssp)
261261
{
262262
unsigned long ret;
263263

264-
preempt_disable(); // Needed for PREEMPT_AUTO
264+
preempt_disable(); // Needed for PREEMPT_LAZY
265265
ret = get_state_synchronize_srcu(ssp);
266266
srcu_gp_start_if_needed(ssp);
267267
preempt_enable();

0 commit comments

Comments
 (0)