aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutorture.c
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux-foundation.org>2009-10-03 06:48:23 -0400
committerTejun Heo <tj@kernel.org>2009-10-03 06:48:23 -0400
commite800879d50c5a528d40191528557b1bdfbccbd42 (patch)
tree5cf00a68df5c0b63dcb8c84f00b0ecb48910c0fa /kernel/rcutorture.c
parent4dac3e98840f11bb2d8d52fd375150c7c1912117 (diff)
this_cpu: Use this_cpu operations in RCU
RCU does not do dynamic allocations but it increments per cpu variables a lot. These instructions results in a move to a register and then back to memory. This patch will make it use the inc/dec instructions on x86 that do not need a register. Acked-by: Tejun Heo <tj@kernel.org> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Christoph Lameter <cl@linux-foundation.org> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/rcutorture.c')
-rw-r--r--kernel/rcutorture.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index 233768f21f97..178967b6434e 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -731,13 +731,13 @@ static void rcu_torture_timer(unsigned long unused)
731 /* Should not happen, but... */ 731 /* Should not happen, but... */
732 pipe_count = RCU_TORTURE_PIPE_LEN; 732 pipe_count = RCU_TORTURE_PIPE_LEN;
733 } 733 }
734 ++__get_cpu_var(rcu_torture_count)[pipe_count]; 734 __this_cpu_inc(per_cpu_var(rcu_torture_count)[pipe_count]);
735 completed = cur_ops->completed() - completed; 735 completed = cur_ops->completed() - completed;
736 if (completed > RCU_TORTURE_PIPE_LEN) { 736 if (completed > RCU_TORTURE_PIPE_LEN) {
737 /* Should not happen, but... */ 737 /* Should not happen, but... */
738 completed = RCU_TORTURE_PIPE_LEN; 738 completed = RCU_TORTURE_PIPE_LEN;
739 } 739 }
740 ++__get_cpu_var(rcu_torture_batch)[completed]; 740 __this_cpu_inc(per_cpu_var(rcu_torture_batch)[completed]);
741 preempt_enable(); 741 preempt_enable();
742 cur_ops->readunlock(idx); 742 cur_ops->readunlock(idx);
743} 743}
@@ -786,13 +786,13 @@ rcu_torture_reader(void *arg)
786 /* Should not happen, but... */ 786 /* Should not happen, but... */
787 pipe_count = RCU_TORTURE_PIPE_LEN; 787 pipe_count = RCU_TORTURE_PIPE_LEN;
788 } 788 }
789 ++__get_cpu_var(rcu_torture_count)[pipe_count]; 789 __this_cpu_inc(per_cpu_var(rcu_torture_count)[pipe_count]);
790 completed = cur_ops->completed() - completed; 790 completed = cur_ops->completed() - completed;
791 if (completed > RCU_TORTURE_PIPE_LEN) { 791 if (completed > RCU_TORTURE_PIPE_LEN) {
792 /* Should not happen, but... */ 792 /* Should not happen, but... */
793 completed = RCU_TORTURE_PIPE_LEN; 793 completed = RCU_TORTURE_PIPE_LEN;
794 } 794 }
795 ++__get_cpu_var(rcu_torture_batch)[completed]; 795 __this_cpu_inc(per_cpu_var(rcu_torture_batch)[completed]);
796 preempt_enable(); 796 preempt_enable();
797 cur_ops->readunlock(idx); 797 cur_ops->readunlock(idx);
798 schedule(); 798 schedule();