aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/percpu_counter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c
index 7473ee3b4ee7..8280a5dd1727 100644
--- a/lib/percpu_counter.c
+++ b/lib/percpu_counter.c
@@ -82,10 +82,10 @@ void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch)
82 unsigned long flags; 82 unsigned long flags;
83 raw_spin_lock_irqsave(&fbc->lock, flags); 83 raw_spin_lock_irqsave(&fbc->lock, flags);
84 fbc->count += count; 84 fbc->count += count;
85 __this_cpu_sub(*fbc->counters, count - amount);
85 raw_spin_unlock_irqrestore(&fbc->lock, flags); 86 raw_spin_unlock_irqrestore(&fbc->lock, flags);
86 __this_cpu_write(*fbc->counters, 0);
87 } else { 87 } else {
88 __this_cpu_write(*fbc->counters, count); 88 this_cpu_add(*fbc->counters, amount);
89 } 89 }
90 preempt_enable(); 90 preempt_enable();
91} 91}