mbox series

[v4,0/9] null_blk fixes, improvements and cleanup

Message ID 20201120015519.276820-1-damien.lemoal@wdc.com (mailing list archive)
Headers show
Series null_blk fixes, improvements and cleanup | expand

Message

Damien Le Moal Nov. 20, 2020, 1:55 a.m. UTC
Jens,

This series provides fixes and improvements for null_blk.

The first two patches are bug fixes which likely should go into 5.10.
The first patch fixes a problem with zone initialization when the
device capacity is not a multiple of the zone size and the second
patch fixes zone append handling.

The following patches are improvements and cleanups:
* Patch 3 makes sure that the device max_sectors limit is aligned to the
  block size.
* Patch 4 improves zone locking overall, and especially the memory
  backing disabled case by introducing a spinlock array to implement a
  per zone lock in place of a global lock. With this patch, write
  performance remains mostly unchanged, but read performance with a
  multi-queue setup more than double from 1.3 MIOPS to 3.3 MIOPS (4K
  random reads to zones with fio zonemode=zbd).
* Patch 5 improves implicit zone close
* Patch 6 and 7 cleanup discard handling code and use that code to free
  the memory backing a zone that is being reset.
* Patch 8 adds the max_sectors configuration option to allow changing
  the max_sectors/max_hw_sectors of the device.
* Finally, patch 9 moves nullblk into its own directory under
  drivers/block/null_blk/

Comments are as always welcome.

Changes from v3:
* Use inline function for zone res lock instead of macro as suggested by
  Christoph.
* Added Reviewed-by tags

Changes from v2:
* Make patch 3 a generic blk-settings fix
* Reworked patch 4 zone locking as suggested by Christoph
* Small change in patch 6 as suggested by Christoph

Changes from v1:
* Added patch 2, 3 and 8.
* Fix the last patch as suggested by Bart (file names under
  driver/block/null_blk/)
* Reworded patch 1 commit message to more correctly describe the
  problem.

Damien Le Moal (9):
  null_blk: Fix zone size initialization
  null_blk: Fail zone append to conventional zones
  block: Align max_hw_sectors to logical blocksize
  null_blk: improve zone locking
  null_blk: Improve implicit zone close
  null_blk: cleanup discard handling
  null_blk: discard zones on reset
  null_blk: Allow controlling max_hw_sectors limit
  null_blk: Move driver into its own directory

 block/blk-settings.c                          |  23 +-
 drivers/block/Kconfig                         |   8 +-
 drivers/block/Makefile                        |   7 +-
 drivers/block/null_blk/Kconfig                |  12 +
 drivers/block/null_blk/Makefile               |  11 +
 .../{null_blk_main.c => null_blk/main.c}      |  63 ++--
 drivers/block/{ => null_blk}/null_blk.h       |  32 +-
 .../{null_blk_trace.c => null_blk/trace.c}    |   2 +-
 .../{null_blk_trace.h => null_blk/trace.h}    |   2 +-
 .../{null_blk_zoned.c => null_blk/zoned.c}    | 333 +++++++++++-------
 10 files changed, 317 insertions(+), 176 deletions(-)
 create mode 100644 drivers/block/null_blk/Kconfig
 create mode 100644 drivers/block/null_blk/Makefile
 rename drivers/block/{null_blk_main.c => null_blk/main.c} (97%)
 rename drivers/block/{ => null_blk}/null_blk.h (83%)
 rename drivers/block/{null_blk_trace.c => null_blk/trace.c} (93%)
 rename drivers/block/{null_blk_trace.h => null_blk/trace.h} (97%)
 rename drivers/block/{null_blk_zoned.c => null_blk/zoned.c} (68%)

Comments

Damien Le Moal Dec. 1, 2020, 2:19 a.m. UTC | #1
On 2020/11/20 10:57, Damien Le Moal wrote:
> Jens,
> 
> This series provides fixes and improvements for null_blk.
> 
> The first two patches are bug fixes which likely should go into 5.10.
> The first patch fixes a problem with zone initialization when the
> device capacity is not a multiple of the zone size and the second
> patch fixes zone append handling.
> 
> The following patches are improvements and cleanups:
> * Patch 3 makes sure that the device max_sectors limit is aligned to the
>   block size.
> * Patch 4 improves zone locking overall, and especially the memory
>   backing disabled case by introducing a spinlock array to implement a
>   per zone lock in place of a global lock. With this patch, write
>   performance remains mostly unchanged, but read performance with a
>   multi-queue setup more than double from 1.3 MIOPS to 3.3 MIOPS (4K
>   random reads to zones with fio zonemode=zbd).
> * Patch 5 improves implicit zone close
> * Patch 6 and 7 cleanup discard handling code and use that code to free
>   the memory backing a zone that is being reset.
> * Patch 8 adds the max_sectors configuration option to allow changing
>   the max_sectors/max_hw_sectors of the device.
> * Finally, patch 9 moves nullblk into its own directory under
>   drivers/block/null_blk/
> 
> Comments are as always welcome.
> 
> Changes from v3:
> * Use inline function for zone res lock instead of macro as suggested by
>   Christoph.
> * Added Reviewed-by tags
> 
> Changes from v2:
> * Make patch 3 a generic blk-settings fix
> * Reworked patch 4 zone locking as suggested by Christoph
> * Small change in patch 6 as suggested by Christoph
> 
> Changes from v1:
> * Added patch 2, 3 and 8.
> * Fix the last patch as suggested by Bart (file names under
>   driver/block/null_blk/)
> * Reworded patch 1 commit message to more correctly describe the
>   problem.
> 
> Damien Le Moal (9):
>   null_blk: Fix zone size initialization
>   null_blk: Fail zone append to conventional zones
>   block: Align max_hw_sectors to logical blocksize
>   null_blk: improve zone locking
>   null_blk: Improve implicit zone close
>   null_blk: cleanup discard handling
>   null_blk: discard zones on reset
>   null_blk: Allow controlling max_hw_sectors limit
>   null_blk: Move driver into its own directory
> 
>  block/blk-settings.c                          |  23 +-
>  drivers/block/Kconfig                         |   8 +-
>  drivers/block/Makefile                        |   7 +-
>  drivers/block/null_blk/Kconfig                |  12 +
>  drivers/block/null_blk/Makefile               |  11 +
>  .../{null_blk_main.c => null_blk/main.c}      |  63 ++--
>  drivers/block/{ => null_blk}/null_blk.h       |  32 +-
>  .../{null_blk_trace.c => null_blk/trace.c}    |   2 +-
>  .../{null_blk_trace.h => null_blk/trace.h}    |   2 +-
>  .../{null_blk_zoned.c => null_blk/zoned.c}    | 333 +++++++++++-------
>  10 files changed, 317 insertions(+), 176 deletions(-)
>  create mode 100644 drivers/block/null_blk/Kconfig
>  create mode 100644 drivers/block/null_blk/Makefile
>  rename drivers/block/{null_blk_main.c => null_blk/main.c} (97%)
>  rename drivers/block/{ => null_blk}/null_blk.h (83%)
>  rename drivers/block/{null_blk_trace.c => null_blk/trace.c} (93%)
>  rename drivers/block/{null_blk_trace.h => null_blk/trace.h} (97%)
>  rename drivers/block/{null_blk_zoned.c => null_blk/zoned.c} (68%)
> 

Jens,

Could you consider this series please ?
Damien Le Moal Dec. 8, 2020, 12:28 a.m. UTC | #2
On 2020/11/20 10:57, Damien Le Moal wrote:
> Jens,
> 
> This series provides fixes and improvements for null_blk.
> 
> The first two patches are bug fixes which likely should go into 5.10.
> The first patch fixes a problem with zone initialization when the
> device capacity is not a multiple of the zone size and the second
> patch fixes zone append handling.
> 
> The following patches are improvements and cleanups:
> * Patch 3 makes sure that the device max_sectors limit is aligned to the
>   block size.
> * Patch 4 improves zone locking overall, and especially the memory
>   backing disabled case by introducing a spinlock array to implement a
>   per zone lock in place of a global lock. With this patch, write
>   performance remains mostly unchanged, but read performance with a
>   multi-queue setup more than double from 1.3 MIOPS to 3.3 MIOPS (4K
>   random reads to zones with fio zonemode=zbd).
> * Patch 5 improves implicit zone close
> * Patch 6 and 7 cleanup discard handling code and use that code to free
>   the memory backing a zone that is being reset.
> * Patch 8 adds the max_sectors configuration option to allow changing
>   the max_sectors/max_hw_sectors of the device.
> * Finally, patch 9 moves nullblk into its own directory under
>   drivers/block/null_blk/
> 
> Comments are as always welcome.

Jens,

Any problem with this series ?

> 
> Changes from v3:
> * Use inline function for zone res lock instead of macro as suggested by
>   Christoph.
> * Added Reviewed-by tags
> 
> Changes from v2:
> * Make patch 3 a generic blk-settings fix
> * Reworked patch 4 zone locking as suggested by Christoph
> * Small change in patch 6 as suggested by Christoph
> 
> Changes from v1:
> * Added patch 2, 3 and 8.
> * Fix the last patch as suggested by Bart (file names under
>   driver/block/null_blk/)
> * Reworded patch 1 commit message to more correctly describe the
>   problem.
> 
> Damien Le Moal (9):
>   null_blk: Fix zone size initialization
>   null_blk: Fail zone append to conventional zones
>   block: Align max_hw_sectors to logical blocksize
>   null_blk: improve zone locking
>   null_blk: Improve implicit zone close
>   null_blk: cleanup discard handling
>   null_blk: discard zones on reset
>   null_blk: Allow controlling max_hw_sectors limit
>   null_blk: Move driver into its own directory
> 
>  block/blk-settings.c                          |  23 +-
>  drivers/block/Kconfig                         |   8 +-
>  drivers/block/Makefile                        |   7 +-
>  drivers/block/null_blk/Kconfig                |  12 +
>  drivers/block/null_blk/Makefile               |  11 +
>  .../{null_blk_main.c => null_blk/main.c}      |  63 ++--
>  drivers/block/{ => null_blk}/null_blk.h       |  32 +-
>  .../{null_blk_trace.c => null_blk/trace.c}    |   2 +-
>  .../{null_blk_trace.h => null_blk/trace.h}    |   2 +-
>  .../{null_blk_zoned.c => null_blk/zoned.c}    | 333 +++++++++++-------
>  10 files changed, 317 insertions(+), 176 deletions(-)
>  create mode 100644 drivers/block/null_blk/Kconfig
>  create mode 100644 drivers/block/null_blk/Makefile
>  rename drivers/block/{null_blk_main.c => null_blk/main.c} (97%)
>  rename drivers/block/{ => null_blk}/null_blk.h (83%)
>  rename drivers/block/{null_blk_trace.c => null_blk/trace.c} (93%)
>  rename drivers/block/{null_blk_trace.h => null_blk/trace.h} (97%)
>  rename drivers/block/{null_blk_zoned.c => null_blk/zoned.c} (68%)
>
Jens Axboe Dec. 8, 2020, 12:36 a.m. UTC | #3
On 11/19/20 6:55 PM, Damien Le Moal wrote:
> Jens,
> 
> This series provides fixes and improvements for null_blk.
> 
> The first two patches are bug fixes which likely should go into 5.10.
> The first patch fixes a problem with zone initialization when the
> device capacity is not a multiple of the zone size and the second
> patch fixes zone append handling.
> 
> The following patches are improvements and cleanups:
> * Patch 3 makes sure that the device max_sectors limit is aligned to the
>   block size.
> * Patch 4 improves zone locking overall, and especially the memory
>   backing disabled case by introducing a spinlock array to implement a
>   per zone lock in place of a global lock. With this patch, write
>   performance remains mostly unchanged, but read performance with a
>   multi-queue setup more than double from 1.3 MIOPS to 3.3 MIOPS (4K
>   random reads to zones with fio zonemode=zbd).
> * Patch 5 improves implicit zone close
> * Patch 6 and 7 cleanup discard handling code and use that code to free
>   the memory backing a zone that is being reset.
> * Patch 8 adds the max_sectors configuration option to allow changing
>   the max_sectors/max_hw_sectors of the device.
> * Finally, patch 9 moves nullblk into its own directory under
>   drivers/block/null_blk/

Applied, thanks.