Skip to content

Commit b3ffb20

Browse files
Ethan Hansenpaulmckrcu
authored andcommitted
rcu: Remove unused variable rcu_perf_writer_state
The variable rcu_perf_writer_state is declared and initialized, but is never actually referenced. Remove it to clean code. Signed-off-by: Ethan Hansen <[email protected]> [ paulmck: Also removed unused macros assigned to that variable. ] Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 9f8ba55 commit b3ffb20

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

kernel/rcu/rcuperf.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,6 @@ static unsigned long b_rcu_perf_writer_started;
109109
static unsigned long b_rcu_perf_writer_finished;
110110
static DEFINE_PER_CPU(atomic_t, n_async_inflight);
111111

112-
static int rcu_perf_writer_state;
113-
#define RTWS_INIT 0
114-
#define RTWS_ASYNC 1
115-
#define RTWS_BARRIER 2
116-
#define RTWS_EXP_SYNC 3
117-
#define RTWS_SYNC 4
118-
#define RTWS_IDLE 5
119-
#define RTWS_STOPPING 6
120-
121112
#define MAX_MEAS 10000
122113
#define MIN_MEAS 100
123114

@@ -404,25 +395,20 @@ rcu_perf_writer(void *arg)
404395
if (!rhp)
405396
rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);
406397
if (rhp && atomic_read(this_cpu_ptr(&n_async_inflight)) < gp_async_max) {
407-
rcu_perf_writer_state = RTWS_ASYNC;
408398
atomic_inc(this_cpu_ptr(&n_async_inflight));
409399
cur_ops->async(rhp, rcu_perf_async_cb);
410400
rhp = NULL;
411401
} else if (!kthread_should_stop()) {
412-
rcu_perf_writer_state = RTWS_BARRIER;
413402
cur_ops->gp_barrier();
414403
goto retry;
415404
} else {
416405
kfree(rhp); /* Because we are stopping. */
417406
}
418407
} else if (gp_exp) {
419-
rcu_perf_writer_state = RTWS_EXP_SYNC;
420408
cur_ops->exp_sync();
421409
} else {
422-
rcu_perf_writer_state = RTWS_SYNC;
423410
cur_ops->sync();
424411
}
425-
rcu_perf_writer_state = RTWS_IDLE;
426412
t = ktime_get_mono_fast_ns();
427413
*wdp = t - *wdp;
428414
i_max = i;
@@ -463,10 +449,8 @@ rcu_perf_writer(void *arg)
463449
rcu_perf_wait_shutdown();
464450
} while (!torture_must_stop());
465451
if (gp_async) {
466-
rcu_perf_writer_state = RTWS_BARRIER;
467452
cur_ops->gp_barrier();
468453
}
469-
rcu_perf_writer_state = RTWS_STOPPING;
470454
writer_n_durations[me] = i_max;
471455
torture_kthread_stopping("rcu_perf_writer");
472456
return 0;

0 commit comments

Comments
 (0)