Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1466941

[PATCH 1/3] rcuperf: Remove unnecessary rcu_perf_writer_state variable

From SeongJae Park <sj38.park@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 1/3] rcuperf: Remove unnecessary rcu_perf_writer_state variable
Date 2016-08-21 10:00 +0200
Message-ID <s8vPI-5WQ-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


rcu_perf_writer_state is being written only while nobody reads it.  This
commit removes the unnecessary variable and macro constants for it.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
 kernel/rcu/rcuperf.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c
index d38ab08..6025342 100644
--- a/kernel/rcu/rcuperf.c
+++ b/kernel/rcu/rcuperf.c
@@ -86,13 +86,6 @@ static u64 t_rcu_perf_writer_finished;
 static unsigned long b_rcu_perf_writer_started;
 static unsigned long b_rcu_perf_writer_finished;
 
-static int rcu_perf_writer_state;
-#define RTWS_INIT		0
-#define RTWS_EXP_SYNC		1
-#define RTWS_SYNC		2
-#define RTWS_IDLE		2
-#define RTWS_STOPPING		3
-
 #define MAX_MEAS 10000
 #define MIN_MEAS 100
 
@@ -381,14 +374,10 @@ rcu_perf_writer(void *arg)
 	do {
 		wdp = &wdpp[i];
 		*wdp = ktime_get_mono_fast_ns();
-		if (gp_exp) {
-			rcu_perf_writer_state = RTWS_EXP_SYNC;
+		if (gp_exp)
 			cur_ops->exp_sync();
-		} else {
-			rcu_perf_writer_state = RTWS_SYNC;
+		else
 			cur_ops->sync();
-		}
-		rcu_perf_writer_state = RTWS_IDLE;
 		t = ktime_get_mono_fast_ns();
 		*wdp = t - *wdp;
 		i_max = i;
@@ -429,7 +418,6 @@ rcu_perf_writer(void *arg)
 			i++;
 		rcu_perf_wait_shutdown();
 	} while (!torture_must_stop());
-	rcu_perf_writer_state = RTWS_STOPPING;
 	writer_n_durations[me] = i_max;
 	torture_kthread_stopping("rcu_perf_writer");
 	return 0;
-- 
1.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] rcuperf: Remove unnecessary rcu_perf_writer_state variable SeongJae Park <sj38.park@gmail.com> - 2016-08-21 10:00 +0200
  [PATCH 2/3] rcuperf: Insert space between flag and message consistently SeongJae Park <sj38.park@gmail.com> - 2016-08-21 10:00 +0200
  Re: [PATCH 1/3] rcuperf: Remove unnecessary rcu_perf_writer_state  variable "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-22 02:20 +0200

csiph-web