Skip to content

Commit b2d76ad

Browse files
koct9iaxboe
authored andcommitted
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>
1 parent 8ab1d40 commit b2d76ad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎include/linux/part_stat.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static inline void part_stat_set_all(struct hd_struct *part, int value)
5454
part_stat_read(part, field[STAT_DISCARD]))
5555

5656
#define __part_stat_add(part, field, addnd) \
57-
(part_stat_get(part, field) += (addnd))
57+
__this_cpu_add((part)->dkstats->field, addnd)
5858

5959
#define part_stat_add(part, field, addnd) do { \
6060
__part_stat_add((part), field, addnd); \

0 commit comments

Comments
 (0)