mirror of
https://github.com/joel16/android_kernel_sony_msm8994_rework.git
synced 2024-11-26 21:30:53 +00:00
lib/percpu_counter.c: __this_cpu_write() doesn't need to be protected by spinlock
__this_cpu_write doesn't need to be protected by spinlock, AS we are doing per cpu write with preempt disabled. And another reason to remove __this_cpu_write outside of spinlock: __percpu_counter_sum is not an accurate counter. Signed-off-by: Fan Du <fan.du@windriver.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Change-Id: Ie3278388886f5cf01f67d6c268f73443cde9e8b5
This commit is contained in:
parent
b2c65a50fb
commit
6caa1815cb
@ -80,8 +80,8 @@ void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch)
|
||||
if (count >= batch || count <= -batch) {
|
||||
raw_spin_lock(&fbc->lock);
|
||||
fbc->count += count;
|
||||
__this_cpu_write(*fbc->counters, 0);
|
||||
raw_spin_unlock(&fbc->lock);
|
||||
__this_cpu_write(*fbc->counters, 0);
|
||||
} else {
|
||||
__this_cpu_write(*fbc->counters, count);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user