Re: [PATCH 06/26] block: Introduce zone write plugging

2024-02-04 Thread Damien Le Moal
On 2/5/24 14:50, Christoph Hellwig wrote: > On Mon, Feb 05, 2024 at 02:37:41PM +0900, Damien Le Moal wrote: >> OK. So I think that Hannes'idea to get/put the queue usage counter reference >> based on a zone BIO plug becoming not empty (get ref) and becoming empty (put >> ref) may be simpler then.

Re: [PATCH 06/26] block: Introduce zone write plugging

2024-02-04 Thread Christoph Hellwig
On Mon, Feb 05, 2024 at 02:37:41PM +0900, Damien Le Moal wrote: > OK. So I think that Hannes'idea to get/put the queue usage counter reference > based on a zone BIO plug becoming not empty (get ref) and becoming empty (put > ref) may be simpler then. And that would also work in the same way for

Re: [PATCH 10/26] dm: Use the block layer zone append emulation

2024-02-04 Thread Damien Le Moal
On 2/4/24 02:58, Mike Snitzer wrote: > Love the overall improvement to the DM core code and the broader block > layer by switching to this bio-based ZWP approach. > > Reviewed-by: Mike Snitzer Thanks Mike ! > But one incremental suggestion inlined below. I made this change, but in a lightly

Re: [PATCH 06/26] block: Introduce zone write plugging

2024-02-04 Thread Damien Le Moal
On 2/5/24 14:11, Christoph Hellwig wrote: > On Mon, Feb 05, 2024 at 11:41:04AM +0900, Damien Le Moal wrote: >>> I think only queue re-configuration(blk_revalidate_zone) requires the >>> queue usage counter. Otherwise, bdev open()/close() should work just >>> fine. >> >> I want to check FS case

Re: [PATCH 06/26] block: Introduce zone write plugging

2024-02-04 Thread Christoph Hellwig
On Mon, Feb 05, 2024 at 11:41:04AM +0900, Damien Le Moal wrote: > > I think only queue re-configuration(blk_revalidate_zone) requires the > > queue usage counter. Otherwise, bdev open()/close() should work just > > fine. > > I want to check FS case though. No clear if mounting FS that supports

Re: [PATCH 06/26] block: Introduce zone write plugging

2024-02-04 Thread Ming Lei
On Mon, Feb 05, 2024 at 11:41:04AM +0900, Damien Le Moal wrote: > On 2/5/24 11:19, Ming Lei wrote: > +static inline void blk_zone_wplug_add_bio(struct blk_zone_wplug *zwplug, > + struct bio *bio, unsigned int > nr_segs) > +{ > +

Re: [PATCH 06/26] block: Introduce zone write plugging

2024-02-04 Thread Damien Le Moal
On 2/5/24 11:19, Ming Lei wrote: +static inline void blk_zone_wplug_add_bio(struct blk_zone_wplug *zwplug, +struct bio *bio, unsigned int nr_segs) +{ + /* + * Keep a reference on the BIO request queue usage. This reference will +

Re: [PATCH 06/26] block: Introduce zone write plugging

2024-02-04 Thread Ming Lei
On Mon, Feb 05, 2024 at 08:57:00AM +0900, Damien Le Moal wrote: > On 2/4/24 12:56, Ming Lei wrote: > > On Fri, Feb 02, 2024 at 04:30:44PM +0900, Damien Le Moal wrote: > >> +/* > >> + * Zone write plug flags bits: > >> + * - BLK_ZONE_WPLUG_CONV: Indicate that the zone is a conventional one. > >>

Re: [PATCH 08/26] block: Implement zone append emulation

2024-02-04 Thread Damien Le Moal
On 2/4/24 21:24, Hannes Reinecke wrote: > On 2/2/24 15:30, Damien Le Moal wrote: >> +/* >> + * Set a zone write plug write pointer offset to either 0 (zone reset case) >> + * or to the zone size (zone finish case). This aborts all plugged BIOs, >> which >> + * is fine to do as doing a zone reset

Re: [PATCH 06/26] block: Introduce zone write plugging

2024-02-04 Thread Damien Le Moal
On 2/4/24 12:56, Ming Lei wrote: > On Fri, Feb 02, 2024 at 04:30:44PM +0900, Damien Le Moal wrote: >> +/* >> + * Zone write plug flags bits: >> + * - BLK_ZONE_WPLUG_CONV: Indicate that the zone is a conventional one. >> Writes >> + *to these zones are never plugged. >> + * -

Re: [PATCHSET wq/for-6.9] workqueue: Implement BH workqueue and convert several tasklet users

2024-02-04 Thread Tejun Heo
On Mon, Jan 29, 2024 at 11:11:47PM -1000, Tejun Heo wrote: > 0001-workqueue-Update-lock-debugging-code.patch > 0002-workqueue-Factor-out-init_cpu_worker_pool.patch > 0003-workqueue-Implement-BH-workqueues-to-eventually-repl.patch > 0004-backtracetest-Convert-from-tasklet-to-BH-workqueue.patch

[PATCH v3 3/8] workqueue: Implement BH workqueues to eventually replace tasklets

2024-02-04 Thread Tejun Heo
>From 4cb1ef64609f9b0254184b2947824f4b46ccab22 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Sun, 4 Feb 2024 11:28:06 -1000 The only generic interface to execute asynchronously in the BH context is tasklet; however, it's marked deprecated and has some design flaws such as the execution code

Re: [PATCH 26/26] block: Add zone_active_wplugs debugfs entry

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:31, Damien Le Moal wrote: Add the zone_active_wplugs debugfs entry to list the zone number and write pointer offset of zones that have an active zone write plug. This helps ensure that struct blk_zone_active_wplug are reclaimed as zones become empty or full and allows observing

Re: [PATCH 25/26] block: Reduce zone write plugging memory usage

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:31, Damien Le Moal wrote: With zone write plugging, each zone of a zoned block device has a 64B struct blk_zone_wplug. While this is not a problem for small capacity drives with few zones, this structure size result in large memory usage per device for large capacity block devices.

Re: [PATCH 24/26] block: Do not special-case plugging of zone write operations

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:31, Damien Le Moal wrote: With the block layer zone write plugging being automatically done for any write operation to a zone of a zoned block device, a regular request plugging handled through current->plug can only ever see at most a single write request per zone. In such case,

Re: [PATCH 23/26] block: Remove zone write locking

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:31, Damien Le Moal wrote: Zone write locking is now unused and replaced with zone write plugging. Remove all code that was implementing zone write locking, that is, the various helper functions controlling request zone write locking and the gendisk attached zone bitmaps. The

Re: [PATCH 22/26] block: Move zone related debugfs attribute to blk-zoned.c

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:31, Damien Le Moal wrote: block/blk-mq-debugfs-zone.c contains a single debugfs attribute function. Defining this outside of block/blk-zoned.c does not really help in any way, so move this zone related debugfs attribute to block/blk-zoned.c and delete block/blk-mq-debugfs-zone.c.

Re: [PATCH 21/26] block: Do not check zone type in blk_check_zone_append()

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: Zone append operations are only allowed to target sequential write required zones. blk_check_zone_append() uses bio_zone_is_seq() to check this. However, this check is not necessary because: 1) For NVMe ZNS namespace devices, only sequential write required

Re: [PATCH 20/26] block: Remove elevator required features

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: The only elevator feature ever implemented is ELEVATOR_F_ZBD_SEQ_WRITE for signaling that a scheduler implements zone write locking to tightly control the dispatching order of write operations to zoned block devices. With the removal of zone write locking

Re: [PATCH 19/26] block: mq-deadline: Remove support for zone write locking

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: With the block layer generic plugging of write operations for zoned block devices, mq-deadline, or any other scheduler, can only ever see at most one write operation per zone at any time. There is thus no sequentiality requirements for these writes and thus

Re: [PATCH 18/26] block: Simplify blk_revalidate_disk_zones() interface

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: The only user of blk_revalidate_disk_zones() second argument was the SCSI disk driver (sd). Now that this driver does not require this update_driver_data argument, remove it to simplify the interface of blk_revalidate_disk_zones(). Also update the function

Re: [PATCH 17/26] block: Remove BLK_STS_ZONE_RESOURCE

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: The zone append emulation of the scsi disk driver was the only driver using BLK_STS_ZONE_RESOURCE. With this code removed, BLK_STS_ZONE_RESOURCE is now unused. Remove this macro definition and simplify blk_mq_dispatch_rq_list() where this status code was

Re: [PATCH 16/26] nvmet: zns: Do not reference the gendisk conv_zones_bitmap

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: The gendisk conventional zone bitmap is going away. So to check for the presence of conventional zones on a zoned target device, always use report zones. Signed-off-by: Damien Le Moal --- drivers/nvme/target/zns.c | 10 +++--- 1 file changed, 3

Re: [PATCH 15/26] null_blk: Introduce fua attribute

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: Add the fua configfs attribute and module parameter to allow configuring if the device supports FUA or not. Using this attribute has an effect on the null_blk device only if memory backing is enabled together with a write cache (cache_size option). This

Re: [PATCH 14/26] null_blk: Introduce zone_append_max_sectors attribute

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: Add the zone_append_max_sectors configfs attribute and module parameter to allow configuring the maximum number of 512B sectors of zone append operations. This attribute is meaningful only for zoned null block devices. If not specified, the default is

Re: [PATCH 13/26] null_blk: Do not request ELEVATOR_F_ZBD_SEQ_WRITE elevator feature

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: With zone write plugging enabled at the block layer level, any zone device can only ever see at most a single write operation per zone. There is thus no need to request a block scheduler with strick per-zone sequential write ordering control through the

Re: [PATCH 12/26] ublk_drv: Do not request ELEVATOR_F_ZBD_SEQ_WRITE elevator feature

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: With zone write plugging enabled at the block layer level, any zone device can only ever see at most a single write operation per zone. There is thus no need to request a block scheduler with strick per-zone sequential write ordering control through the

Re: [PATCH 10/26] dm: Use the block layer zone append emulation

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: For targets requiring zone append operation emulation with regular writes (e.g. dm-crypt), we can use the block layer emulation provided by zone write plugging. Remove DM implemented zone append emulation and enable the block layer one. This is done by

Re: [PATCH 11/26] scsi: sd: Use the block layer zone append emulation

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: Set the request queue of a TYPE_ZBC device as needing zone append emulation by setting the device queue max_zone_append_sectors limit to 0. This enables the block layer generic implementation provided by zone write plugging. With this, the sd driver will

Re: [PATCH 09/26] block: Allow BIO-based drivers to use blk_revalidate_disk_zones()

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: Remove the check in blk_revalidate_disk_zones() restricting the use of this function to mq request-based drivers to allow also BIO-based drivers to use it. This is safe to do as long as the BIO-based block device queue is already setup and usable, as it

Re: [PATCH 08/26] block: Implement zone append emulation

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: Given that zone write plugging manages all writes to zones of a zoned block device, we can track the write pointer position of all zones in order to implement zone append emulation using regular write operations. This is needed for devices that do not

Re: [PATCH 07/26] block: Allow zero value of max_zone_append_sectors queue limit

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: In preparation for adding a generic zone append emulation using zone write plugging, allow device drivers supporting zoned block device to set a the max_zone_append_sectors queue limit of a device to 0 to indicate the lack of native support for zone append

Re: [PATCH 06/26] block: Introduce zone write plugging

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: Zone write plugging implements a per-zone "plug" for write operations to tightly control the submission and execution order of writes to sequential write required zones of a zoned block device. Per-zone plugging of writes guarantees that at any time at most

Re: [PATCH 05/26] block: Allow using bio_attempt_back_merge() internally

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: Remove the static definition of bio_attempt_back_merge() to allow using this function internally from other block layer files. Add the definition of enum bio_merge_status and the declaration of bio_attempt_back_merge() to block/blk.h. Signed-off-by: Damien

Re: [PATCH 04/26] block: Introduce blk_zone_complete_request_bio()

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: On completion of a zone append request, the request sector indicates the location of the written data. This value must be returned to the user through the BIO iter sector. This is done in 2 places: in blk_complete_request() and in req_bio_endio(). Introduce

Re: [PATCH 03/26] block: Introduce bio_straddle_zones() and bio_offset_from_zone_start()

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: Implement the inline helper functions bio_straddle_zones() and bio_offset_from_zone_start() to respectively test if a BIO crosses a zone boundary (the start sector and last sector belong to different zones) and to obtain the oofset from a zone starting

Re: [PATCH 02/26] block: Remove req_bio_endio()

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: Moving req_bio_endio() code into its only caller, blk_update_request(), allows reducing accesses to and tests of bio and request fields. Also, given that partial completions of zone append operations is not possible and that zone append operations cannot be

Re: [PATCH 01/26] block: Restore sector of flush requests

2024-02-04 Thread Hannes Reinecke
On 2/2/24 15:30, Damien Le Moal wrote: On completion of a flush sequence, blk_flush_restore_request() restores the bio of a request to the original submitted BIO. However, the last use of the request in the flush sequence may have been for a POSTFLUSH which does not have a sector. So make sure