2 #include <linux/percpu_counter.h>
3 #include <linux/sched.h>
5 void percpu_counter_mod(struct percpu_counter
*fbc
, long amount
)
8 long count
= fbc
->counters
[cpu
].count
;
11 if (count
>= FBC_BATCH
|| count
<= -FBC_BATCH
) {
12 spin_lock(&fbc
->lock
);
14 spin_unlock(&fbc
->lock
);
17 fbc
->counters
[cpu
].count
= count
;