diff options
author | Mike Snitzer <snitzer@redhat.com> | 2018-12-06 11:41:18 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-12-10 10:30:37 -0500 |
commit | 112f158f66cbe25fd561a5dfe9c3826e06abf757 (patch) | |
tree | 192a838ddd4e61581e6be953dc843d84730de6e8 /block/bio.c | |
parent | dbd3bbd291a03f1383de6242e7999e8487cb869b (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.c | 16 |
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, | |||
1668 | unsigned long sectors, struct hd_struct *part) | 1668 | unsigned long sectors, struct hd_struct *part) |
1669 | { | 1669 | { |
1670 | const int sgrp = op_stat_group(op); | 1670 | const int sgrp = op_stat_group(op); |
1671 | int cpu = part_stat_lock(); | ||
1672 | 1671 | ||
1673 | part_round_stats(q, cpu, part); | 1672 | part_stat_lock(); |
1674 | part_stat_inc(cpu, part, ios[sgrp]); | 1673 | |
1675 | part_stat_add(cpu, part, sectors[sgrp], sectors); | 1674 | part_round_stats(q, part); |
1675 | part_stat_inc(part, ios[sgrp]); | ||
1676 | part_stat_add(part, sectors[sgrp], sectors); | ||
1676 | part_inc_in_flight(q, part, op_is_write(op)); | 1677 | part_inc_in_flight(q, part, op_is_write(op)); |
1677 | 1678 | ||
1678 | part_stat_unlock(); | 1679 | part_stat_unlock(); |
@@ -1684,10 +1685,11 @@ void generic_end_io_acct(struct request_queue *q, int req_op, | |||
1684 | { | 1685 | { |
1685 | unsigned long duration = jiffies - start_time; | 1686 | unsigned long duration = jiffies - start_time; |
1686 | const int sgrp = op_stat_group(req_op); | 1687 | const int sgrp = op_stat_group(req_op); |
1687 | int cpu = part_stat_lock(); | ||
1688 | 1688 | ||
1689 | part_stat_add(cpu, part, nsecs[sgrp], jiffies_to_nsecs(duration)); | 1689 | part_stat_lock(); |
1690 | part_round_stats(q, cpu, part); | 1690 | |
1691 | part_stat_add(part, nsecs[sgrp], jiffies_to_nsecs(duration)); | ||
1692 | part_round_stats(q, part); | ||
1691 | part_dec_in_flight(q, part, op_is_write(req_op)); | 1693 | part_dec_in_flight(q, part, op_is_write(req_op)); |
1692 | 1694 | ||
1693 | part_stat_unlock(); | 1695 | part_stat_unlock(); |