]> git.baikalelectronics.ru Git - kernel.git/commit
percpu_counter: new function percpu_counter_sum_and_set
authorMingming Cao <cmm@us.ibm.com>
Fri, 11 Jul 2008 23:27:31 +0000 (19:27 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 11 Jul 2008 23:27:31 +0000 (19:27 -0400)
commit79f36b442a30622523d6b82ca8f65c9112d016d3
treecd4d643bfbd37c67ff9bd2feff2c0b477a56f117
parent4326beed9ff8d6bd26f91558b620ff6010381607
percpu_counter: new function percpu_counter_sum_and_set

Delayed allocation need to check free blocks at every write time.
percpu_counter_read_positive() is not quit accurate. delayed
allocation need a more accurate accounting, but using
percpu_counter_sum_positive() is frequently is quite expensive.

This patch added a new function to update center counter when sum
per-cpu counter, to increase the accurate rate for next
percpu_counter_read() and require less calling expensive
percpu_counter_sum().

Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/balloc.c
include/linux/percpu_counter.h
lib/percpu_counter.c