Lines Matching full:amount
60 void percpu_counter_set(struct percpu_counter *fbc, s64 amount) in percpu_counter_set() argument
70 fbc->count = amount; in percpu_counter_set()
93 void percpu_counter_add_batch(struct percpu_counter *fbc, s64 amount, s32 batch) in percpu_counter_add_batch() argument
100 if (unlikely(abs(count + amount) >= batch)) { in percpu_counter_add_batch()
107 fbc->count += count + amount; in percpu_counter_add_batch()
112 } while (!this_cpu_try_cmpxchg(*fbc->counters, &count, count + amount)); in percpu_counter_add_batch()
120 void percpu_counter_add_batch(struct percpu_counter *fbc, s64 amount, s32 batch) in percpu_counter_add_batch() argument
126 count = __this_cpu_read(*fbc->counters) + amount; in percpu_counter_add_batch()
130 __this_cpu_sub(*fbc->counters, count - amount); in percpu_counter_add_batch()
133 this_cpu_add(*fbc->counters, amount); in percpu_counter_add_batch()
188 int __percpu_counter_init_many(struct percpu_counter *fbc, s64 amount, in __percpu_counter_init_many() argument
211 fbc[i].count = amount; in __percpu_counter_init_many()
316 * Compare counter, and add amount if total is: less than or equal to limit if
317 * amount is positive, or greater than or equal to limit if amount is negative.
318 * Return true if amount is added, or false if total would be beyond the limit.
324 * Overflow beyond S64_MAX is not allowed for: counter, limit and amount
328 s64 limit, s64 amount, s32 batch) in __percpu_counter_limited_add() argument
335 if (amount == 0) in __percpu_counter_limited_add()
343 if (abs(count + amount) <= batch && in __percpu_counter_limited_add()
344 ((amount > 0 && fbc->count + unknown <= limit) || in __percpu_counter_limited_add()
345 (amount < 0 && fbc->count - unknown >= limit))) { in __percpu_counter_limited_add()
346 this_cpu_add(*fbc->counters, amount); in __percpu_counter_limited_add()
352 count = fbc->count + amount; in __percpu_counter_limited_add()
355 if (amount > 0) { in __percpu_counter_limited_add()
375 if (amount > 0) { in __percpu_counter_limited_add()
386 fbc->count += count + amount; in __percpu_counter_limited_add()