]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - lib/percpu_counter.c
lib/percpu_counter.c: __this_cpu_write() doesn't need to be protected by spinlock
[karo-tx-linux.git] / lib / percpu_counter.c
index ba6085d9c7411f33bbb6aa0077423e822ad1c3dc..1fc23a3277e13794eca7d230ae2ff79aa9c1e4b5 100644 (file)
@@ -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);
        }