linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Damien Le Moal <damien.lemoal@wdc.com>,
	Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-ide@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH v8 1/5] block: Add independent access ranges support
Date: Thu, 9 Sep 2021 07:59:48 +0200	[thread overview]
Message-ID: <d708e1a9-f8ad-e8f9-4d21-c2fca8cb4de7@suse.de> (raw)
In-Reply-To: <20210909023545.1101672-2-damien.lemoal@wdc.com>

On 9/9/21 4:35 AM, Damien Le Moal wrote:
> 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>
> ---
>   block/Makefile         |   2 +-
>   block/blk-ia-ranges.c  | 348 +++++++++++++++++++++++++++++++++++++++++
>   block/blk-sysfs.c      |  26 ++-
>   block/blk.h            |   4 +
>   include/linux/blkdev.h |  39 +++++
>   5 files changed, 410 insertions(+), 9 deletions(-)
>   create mode 100644 block/blk-ia-ranges.c
> Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

  reply	other threads:[~2021-09-09  5:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09  2:35 [PATCH v8 0/5] Initial support for multi-actuator HDDs Damien Le Moal
2021-09-09  2:35 ` [PATCH v8 1/5] block: Add independent access ranges support Damien Le Moal
2021-09-09  5:59   ` Hannes Reinecke [this message]
2021-09-09  2:35 ` [PATCH v8 2/5] scsi: sd: add concurrent positioning " Damien Le Moal
2021-09-09  6:00   ` Hannes Reinecke
2021-09-09  2:35 ` [PATCH v8 3/5] libata: support concurrent positioning ranges log Damien Le Moal
2021-09-09  2:35 ` [PATCH v8 4/5] doc: document sysfs queue/independent_access_ranges attributes Damien Le Moal
2021-09-09  2:35 ` [PATCH v8 5/5] doc: Fix typo in request queue sysfs documentation Damien Le Moal
2021-09-14  0:38 ` [PATCH v8 0/5] Initial support for multi-actuator HDDs Damien Le Moal
2021-09-27  9:17 ` Damien Le Moal
2021-09-29  3:55 ` Martin K. Petersen
2021-10-11  7:50 ` Damien Le Moal
2021-10-11 11:28   ` Tim Walker
2021-10-15  8:20   ` Damien Le Moal
2021-10-27  0:34 ` Keith Busch
2021-10-27  0:45 ` Jens Axboe
2021-10-27  0:49   ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d708e1a9-f8ad-e8f9-4d21-c2fca8cb4de7@suse.de \
    --to=hare@suse.de \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).