zloop: add max_open_zones option
Subsystems (4)
Damien Le Moal
maintainerPATCH 1/1 zloop: add max_open_zones option
Introduce the new max_open_zones option to allow specifying a limit on the maximum number of open zones of a zloop device. This change allows creating a zloop device that can more closely mimick the characteristics of a physical SMR drive.
When set to a non zero value, only up to max_open_zones zones can be in the implicit open (BLK_ZONE_COND_IMP_OPEN) and explicit open (BLK_ZONE_COND_EXP_OPEN) conditions at any time. The transition to the implicit open condition of a zone on a write operation can result in an implicit close of an already implicitly open zone. This is handled in the function zloop_do_open_zone(). This function also handles transitions to the explicit open condition. Implicit close transitions are handled using an LRU ordered list of open zones which is managed using the helper functions zloop_lru_rotate_open_zone() and zloop_lru_remove_open_zone().
--- .../admin-guide/blockdev/zoned_loop.rst | 5 +- drivers/block/zloop.c | 180 ++++++++++++++++-- 2 files changed, 168 insertions(+), 17 deletions(-)
Documentation/admin-guide/blockdev/zoned_loop.rst +4 -1
@@ -62,7 +62,7 @@ The options available for the add command can be listed by reading the /dev/zloop-control device:: $ cat /dev/zloop-control - add id=%d,capacity_mb=%u,zone_size_mb=%u,zone_capacity_mb=%u,conv_zones=%u,base_dir=%s,nr_queues=%u,queue_depth=%u,buffered_io + add id=%d,capacity_mb=%u,zone_size_mb=%u,zone_capacity_mb=%u,conv_zones=%u,max_open_zones=%u,base_dir=%s,nr_queues=%u,queue_depth=%u,buffered_io,zone_append=%u,ordered_zone_append,discard_write_cache remove id=%d In more details, the options that can be used with the "add" command are as
@@ -80,6 +80,9 @@ zone_capacity_mb Device zone capacity (must always be equal to or lower conv_zones Total number of conventioanl zones starting from sector 0 Default: 8 +max_open_zones Maximum number of open sequential write required zones + (0 for no limit). + Default: 0 base_dir Path to the base directory where to create the directory containing the zone files of the device. Default=/var/local/zloop.
drivers/block/zloop.c +164 -16
322 lines not on this page · raw message
Signature · 1 line
2.53.0
Looks good:
Looks good,
Quoted 16 lines · Damien Le Moal
Introduce the new
max_open_zonesoption to allow specifying a limit on the maximum number of open zones of a zloop device. This change allows creating a zloop device that can more closely mimick the characteristics of a physical SMR drive.When set to a non zero value, only up to
max_open_zoneszones can be in the implicit open (BLK_ZONE_COND_IMP_OPEN) and explicit open (BLK_ZONE_COND_EXP_OPEN) conditions at any time. The transition to the implicit open condition of a zone on a write operation can result in an implicit close of an already implicitly open zone. This is handled in the functionzloop_do_open_zone(). This function also handles transitions to the explicit open condition. Implicit close transitions are handled using an LRU ordered list of open zones which is managed using the helper functionszloop_lru_rotate_open_zone()andzloop_lru_remove_open_zone().
Quoted 1 line
[...]
Applied, thanks!
[1/1] zloop: add max_open_zones option
commit: b2a78fec344ead9ffca63ee13018f482392bf09d
Best regards,
Signature · 1 line
Jens Axboe