aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-stat.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2019-11-26 11:06:19 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-11-26 11:06:19 -0300
commit2ea352d5960ad469f5712cf3e293db97beac4e01 (patch)
treec24ae19073f2884867b310ee193d36a82075b60f /block/blk-stat.c
parentMerge branch 'x86/core' into perf/core, to resolve conflicts and to pick up completed topic tree (diff)
parentMerge tag 'for-linus-5.5-1' of git://github.com/cminyard/linux-ipmi (diff)
downloadlinux-dev-2ea352d5960ad469f5712cf3e293db97beac4e01.tar.xz
linux-dev-2ea352d5960ad469f5712cf3e293db97beac4e01.zip
Merge remote-tracking branch 'torvalds/master' into perf/core
To pick up BPF changes we'll need. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'block/blk-stat.c')
-rw-r--r--block/blk-stat.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/blk-stat.c b/block/blk-stat.c
index 940f15d600f8..7da302ff88d0 100644
--- a/block/blk-stat.c
+++ b/block/blk-stat.c
@@ -53,7 +53,7 @@ void blk_stat_add(struct request *rq, u64 now)
struct request_queue *q = rq->q;
struct blk_stat_callback *cb;
struct blk_rq_stat *stat;
- int bucket;
+ int bucket, cpu;
u64 value;
value = (now >= rq->io_start_time_ns) ? now - rq->io_start_time_ns : 0;
@@ -61,6 +61,7 @@ void blk_stat_add(struct request *rq, u64 now)
blk_throtl_stat_add(rq, value);
rcu_read_lock();
+ cpu = get_cpu();
list_for_each_entry_rcu(cb, &q->stats->callbacks, list) {
if (!blk_stat_is_active(cb))
continue;
@@ -69,10 +70,10 @@ void blk_stat_add(struct request *rq, u64 now)
if (bucket < 0)
continue;
- stat = &get_cpu_ptr(cb->cpu_stat)[bucket];
+ stat = &per_cpu_ptr(cb->cpu_stat, cpu)[bucket];
blk_rq_stat_add(stat, value);
- put_cpu_ptr(cb->cpu_stat);
}
+ put_cpu();
rcu_read_unlock();
}