diff options
author | Tejun Heo <tj@kernel.org> | 2012-03-08 10:53:57 -0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-03-20 12:45:37 +0100 |
commit | 5fe224d2d5fbf8f020b30d0ba69fed7856923752 (patch) | |
tree | 26941c40cd28c4f7070e8edab338d340afd2bc99 /block/blk-cgroup.c | |
parent | 1cd9e039fc258f91fe38b97b3c622b13a3b8a795 (diff) |
blkcg: don't use percpu for merged stats
With recent plug merge updates, merged stats are no longer called for
plug merges and now only updated while holding queue_lock. As
stats_lock is scheduled to be removed, there's no reason to use percpu
for merged stats. Don't use percpu for merged 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-cgroup.c')
-rw-r--r-- | block/blk-cgroup.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 622fb4143226..6eedf3afa276 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -451,27 +451,13 @@ void blkiocg_update_io_merged_stats(struct blkio_group *blkg, bool direction, bool sync) { struct blkg_policy_data *pd = blkg->pd[pol->plid]; - struct blkio_group_stats_cpu *stats_cpu; + struct blkio_group_stats *stats; unsigned long flags; - /* If per cpu stats are not allocated yet, don't do any accounting. */ - if (pd->stats_cpu == NULL) - return; - - /* - * Disabling interrupts to provide mutual exclusion between two - * writes on same cpu. It probably is not needed for 64bit. Not - * optimizing that case yet. - */ - local_irq_save(flags); - - stats_cpu = this_cpu_ptr(pd->stats_cpu); - - u64_stats_update_begin(&stats_cpu->syncp); - blkio_add_stat(stats_cpu->stat_arr_cpu[BLKIO_STAT_CPU_MERGED], 1, - direction, sync); - u64_stats_update_end(&stats_cpu->syncp); - local_irq_restore(flags); + spin_lock_irqsave(&blkg->stats_lock, flags); + stats = &pd->stats; + blkio_add_stat(stats->stat_arr[BLKIO_STAT_MERGED], 1, direction, sync); + spin_unlock_irqrestore(&blkg->stats_lock, flags); } EXPORT_SYMBOL_GPL(blkiocg_update_io_merged_stats); @@ -1342,7 +1328,7 @@ static int blkiocg_file_read_map(struct cgroup *cgrp, struct cftype *cft, BLKIO_STAT_WAIT_TIME, 1, 0); case BLKIO_PROP_io_merged: return blkio_read_blkg_stats(blkcg, cft, cb, - BLKIO_STAT_CPU_MERGED, 1, 1); + BLKIO_STAT_MERGED, 1, 0); case BLKIO_PROP_io_queued: return blkio_read_blkg_stats(blkcg, cft, cb, BLKIO_STAT_QUEUED, 1, 0); |