mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 05:04:09 +08:00
a2247f19ee
The Concurrent Positioning Ranges VPD page (for SCSI) and data log page (for ATA) contain parameters describing the set of contiguous LBAs that can be served independently by a single LUN multi-actuator hard-disk. Similarly, a logically defined block device composed of multiple disks can in some cases execute requests directed at different sector ranges in parallel. A dm-linear device aggregating 2 block devices together is an example. This patch implements support for exposing a block device independent access ranges to the user through sysfs to allow optimizing device accesses to increase performance. To describe the set of independent sector ranges of a device (actuators of a multi-actuator HDDs or table entries of a dm-linear device), The type struct blk_independent_access_ranges is introduced. This structure describes the sector ranges using an array of struct blk_independent_access_range structures. This range structure defines the start sector and number of sectors of the access range. The ranges in the array cannot overlap and must contain all sectors within the device capacity. The function disk_set_independent_access_ranges() allows a device driver to signal to the block layer that a device has multiple independent access ranges. In this case, a struct blk_independent_access_ranges is attached to the device request queue by the function disk_set_independent_access_ranges(). The function disk_alloc_independent_access_ranges() is provided for drivers to allocate this structure. struct blk_independent_access_ranges contains kobjects (struct kobject) to expose to the user through sysfs the set of independent access ranges supported by a device. When the device is initialized, sysfs registration of the ranges information is done from blk_register_queue() using the block layer internal function disk_register_independent_access_ranges(). If a driver calls disk_set_independent_access_ranges() for a registered queue, e.g. when a device is revalidated, disk_set_independent_access_ranges() will execute disk_register_independent_access_ranges() to update the sysfs attribute files. The sysfs file structure created starts from the independent_access_ranges sub-directory and contains the start sector and number of sectors of each range, with the information for each range grouped in numbered sub-directories. E.g. for a dual actuator HDD, the user sees: $ tree /sys/block/sdk/queue/independent_access_ranges/ /sys/block/sdk/queue/independent_access_ranges/ |-- 0 | |-- nr_sectors | `-- sector `-- 1 |-- nr_sectors `-- sector For a regular device with a single access range, the independent_access_ranges sysfs directory does not exist. Device revalidation may lead to changes to this structure and to the attribute values. When manipulated, the queue sysfs_lock and sysfs_dir_lock mutexes are held for atomicity, similarly to how the blk-mq and elevator sysfs queue sub-directories are protected. The code related to the management of independent access ranges is added in the new file block/blk-ia-ranges.c. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Keith Busch <kbusch@kernel.org> Link: https://lore.kernel.org/r/20211027022223.183838-2-damien.lemoal@wdc.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
42 lines
1.7 KiB
Makefile
42 lines
1.7 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Makefile for the kernel block layer
|
|
#
|
|
|
|
obj-y := bdev.o fops.o bio.o elevator.o blk-core.o blk-sysfs.o \
|
|
blk-flush.o blk-settings.o blk-ioc.o blk-map.o \
|
|
blk-exec.o blk-merge.o blk-timeout.o \
|
|
blk-lib.o blk-mq.o blk-mq-tag.o blk-stat.o \
|
|
blk-mq-sysfs.o blk-mq-cpumap.o blk-mq-sched.o ioctl.o \
|
|
genhd.o ioprio.o badblocks.o partitions/ blk-rq-qos.o \
|
|
disk-events.o blk-ia-ranges.o
|
|
|
|
obj-$(CONFIG_BOUNCE) += bounce.o
|
|
obj-$(CONFIG_BLK_DEV_BSG_COMMON) += bsg.o
|
|
obj-$(CONFIG_BLK_DEV_BSGLIB) += bsg-lib.o
|
|
obj-$(CONFIG_BLK_CGROUP) += blk-cgroup.o
|
|
obj-$(CONFIG_BLK_CGROUP_RWSTAT) += blk-cgroup-rwstat.o
|
|
obj-$(CONFIG_BLK_DEV_THROTTLING) += blk-throttle.o
|
|
obj-$(CONFIG_BLK_CGROUP_IOPRIO) += blk-ioprio.o
|
|
obj-$(CONFIG_BLK_CGROUP_IOLATENCY) += blk-iolatency.o
|
|
obj-$(CONFIG_BLK_CGROUP_IOCOST) += blk-iocost.o
|
|
obj-$(CONFIG_MQ_IOSCHED_DEADLINE) += mq-deadline.o
|
|
obj-$(CONFIG_MQ_IOSCHED_KYBER) += kyber-iosched.o
|
|
bfq-y := bfq-iosched.o bfq-wf2q.o bfq-cgroup.o
|
|
obj-$(CONFIG_IOSCHED_BFQ) += bfq.o
|
|
|
|
obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o blk-integrity.o
|
|
obj-$(CONFIG_BLK_DEV_INTEGRITY_T10) += t10-pi.o
|
|
obj-$(CONFIG_BLK_MQ_PCI) += blk-mq-pci.o
|
|
obj-$(CONFIG_BLK_MQ_VIRTIO) += blk-mq-virtio.o
|
|
obj-$(CONFIG_BLK_MQ_RDMA) += blk-mq-rdma.o
|
|
obj-$(CONFIG_BLK_DEV_ZONED) += blk-zoned.o
|
|
obj-$(CONFIG_BLK_WBT) += blk-wbt.o
|
|
obj-$(CONFIG_BLK_DEBUG_FS) += blk-mq-debugfs.o
|
|
obj-$(CONFIG_BLK_DEBUG_FS_ZONED)+= blk-mq-debugfs-zoned.o
|
|
obj-$(CONFIG_BLK_SED_OPAL) += sed-opal.o
|
|
obj-$(CONFIG_BLK_PM) += blk-pm.o
|
|
obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += blk-crypto.o blk-crypto-profile.o
|
|
obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o
|
|
obj-$(CONFIG_BLOCK_HOLDER_DEPRECATED) += holder.o
|