summaryrefslogtreecommitdiffstats
path: root/include/linux/part_stat.h
Commit message (Collapse)AuthorAgeFilesLines
* block: use __this_cpu_add() instead of access by smp_processor_id()Konstantin Khlebnikov2020-05-271-1/+1
| | | | | | | | | | | 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>
* block: remove rcu_read_lock() from part_stat_lock()Konstantin Khlebnikov2020-05-271-2/+2
| | | | | | | | | | | | | The RCU lock is required only in disk_map_sector_rcu() to lookup the partition. After that request holds reference to related hd_struct. Replace get_cpu() with preempt_disable() - returned cpu index is unused. [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>
* block: always use a percpu variable for disk statsChristoph Hellwig2020-05-271-44/+11
| | | | | | | | | percpu variables have a perfectly fine working stub implementation for UP kernels, so use that. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: Jens Axboe <axboe@kernel.dk>
* block: move the part_stat* helpers from genhd.h to a new headerChristoph Hellwig2020-03-251-0/+115
These macros are just used by a few files. Move them out of genhd.h, which is included everywhere into a new standalone header. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>