diff options
author | Konstantin Khlebnikov <khlebnikov@yandex-team.ru> | 2020-05-27 08:24:18 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-05-27 14:21:23 +0300 |
commit | b2d76adbc0828e0f108567973bcc500ed1abc139 (patch) | |
tree | 52ec69527822f170482e23c977c1bdaa9610fb5c /include/linux/part_stat.h | |
parent | 8ab1d40a646e753adb6814642432a093d93dbf47 (diff) | |
download | linux-b2d76adbc0828e0f108567973bcc500ed1abc139.tar.xz |
block: use __this_cpu_add() instead of access by smp_processor_id()
Most architectures have fast path to access percpu for current cpu.
The required preempt_disable() is provided by part_stat_lock().
[hch: rebased]
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/part_stat.h')
-rw-r--r-- | include/linux/part_stat.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/part_stat.h b/include/linux/part_stat.h index a6b0938ce82e..24125778ef3e 100644 --- a/include/linux/part_stat.h +++ b/include/linux/part_stat.h @@ -54,7 +54,7 @@ static inline void part_stat_set_all(struct hd_struct *part, int value) part_stat_read(part, field[STAT_DISCARD])) #define __part_stat_add(part, field, addnd) \ - (part_stat_get(part, field) += (addnd)) + __this_cpu_add((part)->dkstats->field, addnd) #define part_stat_add(part, field, addnd) do { \ __part_stat_add((part), field, addnd); \ |