diff options
author | Tejun Heo <tj@kernel.org> | 2012-03-08 10:53:58 -0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-03-20 12:45:37 +0100 |
commit | 997a026c80c3cc05f82e589aced1f0011c17d376 (patch) | |
tree | 905fe49970f8549663e1e70e77dd04811fd14c9c /block/blk-exec.c | |
parent | blkcg: don't use percpu for merged stats (diff) | |
download | linux-dev-997a026c80c3cc05f82e589aced1f0011c17d376.tar.xz linux-dev-997a026c80c3cc05f82e589aced1f0011c17d376.zip |
blkcg: simplify stat reset
blkiocg_reset_stats() implements stat reset for blkio.reset_stats
cgroupfs file. This feature is very unconventional and something
which shouldn't have been merged. It's only useful when there's only
one user or tool looking at the stats. As soon as multiple users
and/or tools are involved, it becomes useless as resetting disrupts
other usages. There are very good reasons why all other stats expect
readers to read values at the start and end of a period and subtract
to determine delta over the period.
The implementation is rather complex - some fields shouldn't be
cleared and it saves some fields, resets whole and restores for some
reason. Reset of percpu stats is also racy. The comment points to
64bit store atomicity for the reason but even without that stores for
zero can simply race with other CPUs doing RMW and get clobbered.
Simplify reset by
* Clear selectively instead of resetting and restoring.
* Grouping debug stat fields to be reset and using memset() over them.
* Not caring about stats_lock.
* Using memset() to reset percpu stats.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-exec.c')
0 files changed, 0 insertions, 0 deletions