mbox series

[v9,0/5] Initial support for multi-actuator HDDs

Message ID 20211027022223.183838-1-damien.lemoal@wdc.com
Headers show
Series Initial support for multi-actuator HDDs | expand

Message

Damien Le Moal Oct. 27, 2021, 2:22 a.m. UTC
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>

Single LUN multi-actuator hard-disks are cappable to seek and execute
multiple commands in parallel. This capability is exposed to the host
using the Concurrent Positioning Ranges VPD page (SCSI) and Log (ATA).
Each positioning range describes the contiguous set of LBAs that an
actuator serves.

This series adds support to the scsi disk driver to retreive this
information and advertize it to user space through sysfs. libata is
also modified to handle ATA drives.

The first patch adds the block layer plumbing to expose concurrent
sector ranges of the device through sysfs as a sub-directory of the
device sysfs queue directory. Patch 2 and 3 add support to sd and
libata. Finally patch 4 documents the sysfs queue attributed changes.
Patch 5 fixes a typo in the document file (strictly speaking, not
related to this series).

This series does not attempt in any way to optimize accesses to
multi-actuator devices (e.g. block IO schedulers or filesystems). This
initial support only exposes the independent access ranges information
to user space through sysfs.

Changes from v8:
* Rebase on latest for-5.16/block tree
* Added reviewed-by tags

Changes from v7:
* Renamed functions to spell out "independent_access_range" instead of
  using contracted names such as iaranges. Structure fields names are
  changed to ia_ranges from iaranges.
* Added reviewed-by tags in patch 4 and 5

Changes from v6:
* Changed patch 1 to prevent a device from registering overlapping
  independent access ranges.

Changes from v5:
* Changed type names in patch 1:
  - struct blk_crange -> sturct blk_independent_access_range
  - struct blk_cranges -> sturct blk_independent_access_ranges
  All functions and variables are renamed accordingly, using shorter
  names related to the new type names, e.g.
  sturct blk_independent_access_ranges -> iaranges or iars.
* Update the commit message of patch 1 to 4. Patch 1 and 4 titles are
  also changed.
* Dropped reviewed-tags on modified patches. Patch 3 and 5 are
  unmodified

Changes from v4:
* Fixed kdoc comment function name mismatch for disk_register_cranges()
  in patch 1

Changes from v3:
* Modified patch 1:
  - Prefix functions that take a struct gendisk as argument with
    "disk_". Modified patch 2 accordingly.
  - Added a functional release operation for struct blk_cranges kobj to
    ensure that this structure is freed only after all references to it
    are released, including kobject_del() execution for all crange sysfs
    entries.
* Added patch 5 to separate the typo fix from the crange documentation
  addition.
* Added reviewed-by tags

Changes from v2:
* Update patch 1 to fix a compilation warning for a potential NULL
  pointer dereference of the cr argument of blk_queue_set_cranges().
  Warning reported by the kernel test robot <lkp@intel.com>).

Changes from v1:
* Moved libata-scsi hunk from patch 1 to patch 3 where it belongs
* Fixed unintialized variable in patch 2
  Reported-by: kernel test robot <lkp@intel.com>
  Reported-by: Dan Carpenter <dan.carpenter@oracle.com
* Changed patch 3 adding struct ata_cpr_log to contain both the number
  of concurrent ranges and the array of concurrent ranges.
* Added a note in the documentation (patch 4) about the unit used for
  the concurrent ranges attributes.

Damien Le Moal (5):
  block: Add independent access ranges support
  scsi: sd: add concurrent positioning ranges support
  libata: support concurrent positioning ranges log
  doc: document sysfs queue/independent_access_ranges attributes
  doc: Fix typo in request queue sysfs documentation

 Documentation/block/queue-sysfs.rst |  33 ++-
 block/Makefile                      |   2 +-
 block/blk-ia-ranges.c               | 348 ++++++++++++++++++++++++++++
 block/blk-sysfs.c                   |  26 ++-
 block/blk.h                         |   4 +
 drivers/ata/libata-core.c           |  57 ++++-
 drivers/ata/libata-scsi.c           |  48 +++-
 drivers/scsi/sd.c                   |  81 +++++++
 drivers/scsi/sd.h                   |   1 +
 include/linux/ata.h                 |   1 +
 include/linux/blkdev.h              |  39 ++++
 include/linux/libata.h              |  15 ++
 12 files changed, 634 insertions(+), 21 deletions(-)
 create mode 100644 block/blk-ia-ranges.c

Comments

Jens Axboe Oct. 27, 2021, 2:37 a.m. UTC | #1
On Wed, 27 Oct 2021 11:22:18 +0900, Damien Le Moal wrote:
> From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
> 
> Single LUN multi-actuator hard-disks are cappable to seek and execute
> multiple commands in parallel. This capability is exposed to the host
> using the Concurrent Positioning Ranges VPD page (SCSI) and Log (ATA).
> Each positioning range describes the contiguous set of LBAs that an
> actuator serves.
> 
> [...]

Applied, thanks!

[1/5] block: Add independent access ranges support
      commit: a2247f19ee1c5ad75ef095cdfb909a3244b88aa8

Best regards,
Jens Axboe Oct. 27, 2021, 2:38 a.m. UTC | #2
On 10/26/21 8:22 PM, Damien Le Moal wrote:
> From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
> 
> Single LUN multi-actuator hard-disks are cappable to seek and execute
> multiple commands in parallel. This capability is exposed to the host
> using the Concurrent Positioning Ranges VPD page (SCSI) and Log (ATA).
> Each positioning range describes the contiguous set of LBAs that an
> actuator serves.
> 
> This series adds support to the scsi disk driver to retreive this
> information and advertize it to user space through sysfs. libata is
> also modified to handle ATA drives.
> 
> The first patch adds the block layer plumbing to expose concurrent
> sector ranges of the device through sysfs as a sub-directory of the
> device sysfs queue directory. Patch 2 and 3 add support to sd and
> libata. Finally patch 4 documents the sysfs queue attributed changes.
> Patch 5 fixes a typo in the document file (strictly speaking, not
> related to this series).
> 
> This series does not attempt in any way to optimize accesses to
> multi-actuator devices (e.g. block IO schedulers or filesystems). This
> initial support only exposes the independent access ranges information
> to user space through sysfs.

I've applied 1/9 for now, as that clearly belongs in the block tree.
Might be the cleanest if SCSI does a post tree that depends on
for-5.16/block. Or I can apply it all as they are reviewed. Let me
know.
Damien Le Moal Oct. 27, 2021, 2:46 a.m. UTC | #3
On 2021/10/27 11:38, Jens Axboe wrote:
> On 10/26/21 8:22 PM, Damien Le Moal wrote:
>> From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
>>
>> Single LUN multi-actuator hard-disks are cappable to seek and execute
>> multiple commands in parallel. This capability is exposed to the host
>> using the Concurrent Positioning Ranges VPD page (SCSI) and Log (ATA).
>> Each positioning range describes the contiguous set of LBAs that an
>> actuator serves.
>>
>> This series adds support to the scsi disk driver to retreive this
>> information and advertize it to user space through sysfs. libata is
>> also modified to handle ATA drives.
>>
>> The first patch adds the block layer plumbing to expose concurrent
>> sector ranges of the device through sysfs as a sub-directory of the
>> device sysfs queue directory. Patch 2 and 3 add support to sd and
>> libata. Finally patch 4 documents the sysfs queue attributed changes.
>> Patch 5 fixes a typo in the document file (strictly speaking, not
>> related to this series).
>>
>> This series does not attempt in any way to optimize accesses to
>> multi-actuator devices (e.g. block IO schedulers or filesystems). This
>> initial support only exposes the independent access ranges information
>> to user space through sysfs.
> 
> I've applied 1/9 for now, as that clearly belongs in the block tree.
> Might be the cleanest if SCSI does a post tree that depends on
> for-5.16/block. Or I can apply it all as they are reviewed. Let me
> know.
> 

Patch 4 & 5 are doc updates and I think they belong to the block tree too.

Patch 3 applies cleanly to libata for-5.16 branch as is, so you can take it, or
I can take it in libata tree too, whichever works for me.

As for patch 2, it applies cleanly to 5.16/scsi-queue so I guess you can take it
too, but I will defer this decision to Martin.
Damien Le Moal Oct. 27, 2021, 2:49 a.m. UTC | #4
On 2021/10/27 11:38, Jens Axboe wrote:
> On 10/26/21 8:22 PM, Damien Le Moal wrote:
>> From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
>>
>> Single LUN multi-actuator hard-disks are cappable to seek and execute
>> multiple commands in parallel. This capability is exposed to the host
>> using the Concurrent Positioning Ranges VPD page (SCSI) and Log (ATA).
>> Each positioning range describes the contiguous set of LBAs that an
>> actuator serves.
>>
>> This series adds support to the scsi disk driver to retreive this
>> information and advertize it to user space through sysfs. libata is
>> also modified to handle ATA drives.
>>
>> The first patch adds the block layer plumbing to expose concurrent
>> sector ranges of the device through sysfs as a sub-directory of the
>> device sysfs queue directory. Patch 2 and 3 add support to sd and
>> libata. Finally patch 4 documents the sysfs queue attributed changes.
>> Patch 5 fixes a typo in the document file (strictly speaking, not
>> related to this series).
>>
>> This series does not attempt in any way to optimize accesses to
>> multi-actuator devices (e.g. block IO schedulers or filesystems). This
>> initial support only exposes the independent access ranges information
>> to user space through sysfs.
> 
> I've applied 1/9 for now, as that clearly belongs in the block tree.
> Might be the cleanest if SCSI does a post tree that depends on
> for-5.16/block. Or I can apply it all as they are reviewed. Let me
> know.

Forgot: They are all reviewed, including Martin who sent a Reviewed-by for the
series, but not an Acked-by for patch 2. As for libata patch 3, obviously, this
is Acked-by me.
Martin K. Petersen Oct. 27, 2021, 2:52 a.m. UTC | #5
Damien,

> As for patch 2, it applies cleanly to 5.16/scsi-queue so I guess you
> can take it too, but I will defer this decision to Martin.

Probably easiest if that goes through block too.
Damien Le Moal Oct. 27, 2021, 2:53 a.m. UTC | #6
On 2021/10/27 11:52, Martin K. Petersen wrote:
> 
> Damien,
> 
>> As for patch 2, it applies cleanly to 5.16/scsi-queue so I guess you
>> can take it too, but I will defer this decision to Martin.
> 
> Probably easiest if that goes through block too.

Thanks !

Jens,

Can you take everything ? Easier that way I think.
Jens Axboe Oct. 27, 2021, 3:03 a.m. UTC | #7
On 10/26/21 8:49 PM, Damien Le Moal wrote:
> On 2021/10/27 11:38, Jens Axboe wrote:
>> On 10/26/21 8:22 PM, Damien Le Moal wrote:
>>> From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
>>>
>>> Single LUN multi-actuator hard-disks are cappable to seek and execute
>>> multiple commands in parallel. This capability is exposed to the host
>>> using the Concurrent Positioning Ranges VPD page (SCSI) and Log (ATA).
>>> Each positioning range describes the contiguous set of LBAs that an
>>> actuator serves.
>>>
>>> This series adds support to the scsi disk driver to retreive this
>>> information and advertize it to user space through sysfs. libata is
>>> also modified to handle ATA drives.
>>>
>>> The first patch adds the block layer plumbing to expose concurrent
>>> sector ranges of the device through sysfs as a sub-directory of the
>>> device sysfs queue directory. Patch 2 and 3 add support to sd and
>>> libata. Finally patch 4 documents the sysfs queue attributed changes.
>>> Patch 5 fixes a typo in the document file (strictly speaking, not
>>> related to this series).
>>>
>>> This series does not attempt in any way to optimize accesses to
>>> multi-actuator devices (e.g. block IO schedulers or filesystems). This
>>> initial support only exposes the independent access ranges information
>>> to user space through sysfs.
>>
>> I've applied 1/9 for now, as that clearly belongs in the block tree.
>> Might be the cleanest if SCSI does a post tree that depends on
>> for-5.16/block. Or I can apply it all as they are reviewed. Let me
>> know.
> 
> Forgot: They are all reviewed, including Martin who sent a Reviewed-by for the
> series, but not an Acked-by for patch 2. As for libata patch 3, obviously, this
> is Acked-by me.

Queued up 2-5 in the for-5.16/scsi-ma branch.
Jens Axboe Oct. 27, 2021, 3:03 a.m. UTC | #8
On Wed, 27 Oct 2021 11:22:18 +0900, Damien Le Moal wrote:
> From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
> 
> Single LUN multi-actuator hard-disks are cappable to seek and execute
> multiple commands in parallel. This capability is exposed to the host
> using the Concurrent Positioning Ranges VPD page (SCSI) and Log (ATA).
> Each positioning range describes the contiguous set of LBAs that an
> actuator serves.
> 
> [...]

Applied, thanks!

[2/5] scsi: sd: add concurrent positioning ranges support
      commit: e815d36548f01797ce381be8f0b74f4ba9befd15
[3/5] libata: support concurrent positioning ranges log
      commit: fe22e1c2f705676a705d821301fc52eecc2fe055
[4/5] doc: document sysfs queue/independent_access_ranges attributes
      commit: 6b3bae2324d2ecaa404ceab869018011b7ef6a90
[5/5] doc: Fix typo in request queue sysfs documentation
      commit: 9d824642889823c464847342d6ff530b9eee3241

Best regards,
Damien Le Moal Oct. 27, 2021, 3:42 a.m. UTC | #9
On 2021/10/27 12:03, Jens Axboe wrote:
> On 10/26/21 8:49 PM, Damien Le Moal wrote:
>> On 2021/10/27 11:38, Jens Axboe wrote:
>>> On 10/26/21 8:22 PM, Damien Le Moal wrote:
>>>> From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
>>>>
>>>> Single LUN multi-actuator hard-disks are cappable to seek and execute
>>>> multiple commands in parallel. This capability is exposed to the host
>>>> using the Concurrent Positioning Ranges VPD page (SCSI) and Log (ATA).
>>>> Each positioning range describes the contiguous set of LBAs that an
>>>> actuator serves.
>>>>
>>>> This series adds support to the scsi disk driver to retreive this
>>>> information and advertize it to user space through sysfs. libata is
>>>> also modified to handle ATA drives.
>>>>
>>>> The first patch adds the block layer plumbing to expose concurrent
>>>> sector ranges of the device through sysfs as a sub-directory of the
>>>> device sysfs queue directory. Patch 2 and 3 add support to sd and
>>>> libata. Finally patch 4 documents the sysfs queue attributed changes.
>>>> Patch 5 fixes a typo in the document file (strictly speaking, not
>>>> related to this series).
>>>>
>>>> This series does not attempt in any way to optimize accesses to
>>>> multi-actuator devices (e.g. block IO schedulers or filesystems). This
>>>> initial support only exposes the independent access ranges information
>>>> to user space through sysfs.
>>>
>>> I've applied 1/9 for now, as that clearly belongs in the block tree.
>>> Might be the cleanest if SCSI does a post tree that depends on
>>> for-5.16/block. Or I can apply it all as they are reviewed. Let me
>>> know.
>>
>> Forgot: They are all reviewed, including Martin who sent a Reviewed-by for the
>> series, but not an Acked-by for patch 2. As for libata patch 3, obviously, this
>> is Acked-by me.
> 
> Queued up 2-5 in the for-5.16/scsi-ma branch.
> 

Thanks !