summaryrefslogtreecommitdiff
path: root/block/bio.c
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2018-12-06 11:41:18 -0500
committerJens Axboe <axboe@kernel.dk>2018-12-10 08:30:37 -0700
commit112f158f66cbe25fd561a5dfe9c3826e06abf757 (patch)
tree192a838ddd4e61581e6be953dc843d84730de6e8 /block/bio.c
parentdbd3bbd291a03f1383de6242e7999e8487cb869b (diff)
block: stop passing 'cpu' to all percpu stats methods
All of part_stat_* and related methods are used with preempt disabled, so there is no need to pass cpu around to allow of them. Just call smp_processor_id() as needed. Suggested-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bio.c')
-rw-r--r--block/bio.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/block/bio.c b/block/bio.c
index 06760543ec81..0aca870331c3 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1668,11 +1668,12 @@ void generic_start_io_acct(struct request_queue *q, int op,
unsigned long sectors, struct hd_struct *part)
{
const int sgrp = op_stat_group(op);
- int cpu = part_stat_lock();
- part_round_stats(q, cpu, part);
- part_stat_inc(cpu, part, ios[sgrp]);
- part_stat_add(cpu, part, sectors[sgrp], sectors);
+ part_stat_lock();
+
+ part_round_stats(q, part);
+ part_stat_inc(part, ios[sgrp]);
+ part_stat_add(part, sectors[sgrp], sectors);
part_inc_in_flight(q, part, op_is_write(op));
part_stat_unlock();
@@ -1684,10 +1685,11 @@ void generic_end_io_acct(struct request_queue *q, int req_op,
{
unsigned long duration = jiffies - start_time;
const int sgrp = op_stat_group(req_op);
- int cpu = part_stat_lock();
- part_stat_add(cpu, part, nsecs[sgrp], jiffies_to_nsecs(duration));
- part_round_stats(q, cpu, part);
+ part_stat_lock();
+
+ part_stat_add(part, nsecs[sgrp], jiffies_to_nsecs(duration));
+ part_round_stats(q, part);
part_dec_in_flight(q, part, op_is_write(req_op));
part_stat_unlock();