Re: [PATCH 19/26] block: move the nowait flag to queue_limits

2024-06-16 Thread Damien Le Moal
On 6/17/24 15:04, Christoph Hellwig wrote: > Move the nowait flag into the queue_limits feature field so that it can > be set atomically with the queue frozen. > > Stacking drivers are simplified in that they now can simply set the > flag, and blk_stack_limits will clear it when the features is no

Re: [PATCH 16/26] block: move the io_stat flag setting to queue_limits

2024-06-16 Thread Damien Le Moal
On 6/17/24 15:04, Christoph Hellwig wrote: > Move the io_stat flag into the queue_limits feature field so that it can > be set atomically with the queue frozen. > > Simplify md and dm to set the flag unconditionally instead of avoiding > setting a simple flag for cases where it already is set by o

Re: [PATCH 13/26] block: move cache control settings out of queue->flags

2024-06-16 Thread Damien Le Moal
On 6/17/24 15:04, Christoph Hellwig wrote: > Move the cache control settings into the queue_limits so that the flags > can be set atomically with the device queue frozen. > > Add new features and flags field for the driver set flags, and internal > (usually sysfs-controlled) flags in the block lay

Re: [PATCH 07/26] loop: also use the default block size from an underlying block device

2024-06-16 Thread Damien Le Moal
On 6/17/24 15:04, Christoph Hellwig wrote: > Fix the code in loop_reconfigure_limits to pick a default block size for > O_DIRECT file descriptors to also work when the loop device sits on top > of a block device and not just on a regular file on a block device based > file system. > > Signed-off-b

Re: [PATCH 06/26] loop: regularize upgrading the block size for direct I/O

2024-06-16 Thread Damien Le Moal
On 6/17/24 15:04, Christoph Hellwig wrote: > The LOOP_CONFIGURE path automatically upgrades the block size to that > of the underlying file for O_DIRECT file descriptors, but the > LOOP_SET_BLOCK_SIZE path does not. Fix this by lifting the code to > pick the block size into common code. > > Signe

[PATCH 26/26] block: move the bounce flag into the features field

2024-06-16 Thread Christoph Hellwig
Move the bounce flag into the features field to reclaim a little bit of space. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal --- block/blk-settings.c| 1 - block/blk.h | 2 +- drivers/scsi/scsi_lib.c | 2 +- include/linux/blkdev.h | 6 -- 4 files changed, 6 i

[PATCH 25/26] block: move the skip_tagset_quiesce flag to queue_limits

2024-06-16 Thread Christoph Hellwig
Move the skip_tagset_quiesce flag into the queue_limits feature field so that it can be set atomically with the queue frozen. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal --- block/blk-mq-debugfs.c | 1 - drivers/nvme/host/core.c | 8 +--- include/linux/blkdev.h | 6

[PATCH 24/26] block: move the pci_p2pdma flag to queue_limits

2024-06-16 Thread Christoph Hellwig
Move the pci_p2pdma flag into the queue_limits feature field so that it can be set atomically with the queue frozen. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal --- block/blk-mq-debugfs.c | 1 - drivers/nvme/host/core.c | 8 +++- include/linux/blkdev.h | 7 --- 3 fi

[PATCH 23/26] block: move the zone_resetall flag to queue_limits

2024-06-16 Thread Christoph Hellwig
Move the zone_resetall flag into the queue_limits feature field so that it can be set atomically with the queue frozen. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal --- block/blk-mq-debugfs.c | 1 - drivers/block/null_blk/zoned.c | 3 +-- drivers/block/ublk_drv.c |

[PATCH 21/26] block: move the poll flag to queue_limits

2024-06-16 Thread Christoph Hellwig
Move the poll flag into the queue_limits feature field so that it can be set atomically with the queue frozen. Stacking drivers are simplified in that they now can simply set the flag, and blk_stack_limits will clear it when the features is not supported by any of the underlying devices. Signed-o

[PATCH 20/26] block: move the dax flag to queue_limits

2024-06-16 Thread Christoph Hellwig
Move the dax flag into the queue_limits feature field so that it can be set atomically with the queue frozen. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal --- block/blk-mq-debugfs.c | 1 - drivers/md/dm-table.c| 4 ++-- drivers/nvdimm/pmem.c| 7 ++- dri

[PATCH 19/26] block: move the nowait flag to queue_limits

2024-06-16 Thread Christoph Hellwig
Move the nowait flag into the queue_limits feature field so that it can be set atomically with the queue frozen. Stacking drivers are simplified in that they now can simply set the flag, and blk_stack_limits will clear it when the features is not supported by any of the underlying devices. Signed

[PATCH 18/26] block: move the synchronous flag to queue_limits

2024-06-16 Thread Christoph Hellwig
Move the synchronous flag into the queue_limits feature field so that it can be set atomically with the queue frozen. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal --- block/blk-mq-debugfs.c| 1 - drivers/block/brd.c | 2 +- drivers/block/zram/zram_drv.c | 4 ++-

[PATCH 17/26] block: move the stable_writes flag to queue_limits

2024-06-16 Thread Christoph Hellwig
Move the stable_writes flag into the queue_limits feature field so that it can be set atomically with the queue frozen. The flag is now inherited by blk_stack_limits, which greatly simplifies the code in dm, and fixed md which previously did not pass on the flag set on lower devices. Signed-off-b

[PATCH 16/26] block: move the io_stat flag setting to queue_limits

2024-06-16 Thread Christoph Hellwig
Move the io_stat flag into the queue_limits feature field so that it can be set atomically with the queue frozen. Simplify md and dm to set the flag unconditionally instead of avoiding setting a simple flag for cases where it already is set by other means, which is a bit pointless. Signed-off-by:

[PATCH 15/26] block: move the add_random flag to queue_limits

2024-06-16 Thread Christoph Hellwig
Move the add_random flag into the queue_limits feature field so that it can be set atomically with the queue frozen. Note that this also removes code from dm to clear the flag based on the underlying devices, which can't be reached as dm devices will always start out without the flag set. Signed-

[PATCH 14/26] block: move the nonrot flag to queue_limits

2024-06-16 Thread Christoph Hellwig
Move the nonrot flag into the queue_limits feature field so that it can be set atomically with the queue frozen. Use the chance to switch to defaulting to non-rotational and require the driver to opt into rotational, which matches the polarity of the sysfs interface. For the z2ram, ps3vram, 2x me

[PATCH 13/26] block: move cache control settings out of queue->flags

2024-06-16 Thread Christoph Hellwig
Move the cache control settings into the queue_limits so that the flags can be set atomically with the device queue frozen. Add new features and flags field for the driver set flags, and internal (usually sysfs-controlled) flags in the block layer. Note that we'll eventually remove enough field f

[PATCH 10/26] nbd: move setting the cache control flags to __nbd_set_size

2024-06-16 Thread Christoph Hellwig
Move setting the cache control flags in nbd in preparation for moving these flags into the queue_limits structure. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Josef Bacik Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke --- drivers/block/nbd.c | 17

[PATCH 09/26] virtio_blk: remove virtblk_update_cache_mode

2024-06-16 Thread Christoph Hellwig
virtblk_update_cache_mode boils down to a single call to blk_queue_write_cache. Remove it in preparation for moving the cache control flags into the queue_limits. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal Reviewed-by

[PATCH 08/26] loop: fold loop_update_rotational into loop_reconfigure_limits

2024-06-16 Thread Christoph Hellwig
This prepares for moving the rotational flag into the queue_limits and also fixes it for the case where the loop device is backed by a block device. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche --- drivers/block/loop.c

[PATCH 07/26] loop: also use the default block size from an underlying block device

2024-06-16 Thread Christoph Hellwig
Fix the code in loop_reconfigure_limits to pick a default block size for O_DIRECT file descriptors to also work when the loop device sits on top of a block device and not just on a regular file on a block device based file system. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Rev

[PATCH 06/26] loop: regularize upgrading the block size for direct I/O

2024-06-16 Thread Christoph Hellwig
The LOOP_CONFIGURE path automatically upgrades the block size to that of the underlying file for O_DIRECT file descriptors, but the LOOP_SET_BLOCK_SIZE path does not. Fix this by lifting the code to pick the block size into common code. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinec

[PATCH 05/26] loop: always update discard settings in loop_reconfigure_limits

2024-06-16 Thread Christoph Hellwig
Simplify loop_reconfigure_limits by always updating the discard limits. This adds a little more work to loop_set_block_size, but doesn't change the outcome as the discard flag won't change. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Ba

[PATCH 03/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-16 Thread Christoph Hellwig
Move a bit of code that sets up the zone flag and the write granularity into sd_zbc_read_zones to be with the rest of the zoned limits. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 21 + drivers/scsi/sd_zbc.c | 9 + 2 files changed, 10 insertions(+),

[PATCH 04/26] loop: stop using loop_reconfigure_limits in __loop_clr_fd

2024-06-16 Thread Christoph Hellwig
__loop_clr_fd wants to clear all settings on the device. Prepare for moving more settings into the block limits by open coding loop_reconfigure_limits. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche --- drivers/block/loo

[PATCH 01/26] xen-blkfront: don't disable cache flushes when they fail

2024-06-16 Thread Christoph Hellwig
blkfront always had a robust negotiation protocol for detecting a write cache. Stop simply disabling cache flushes in the block layer as the flags handling is moving to the atomic queue limits API that needs user context to freeze the queue for that. Instead handle the case of the feature flags c

[PATCH 02/26] sd: remove sd_is_zoned

2024-06-16 Thread Christoph Hellwig
Since commit 7437bb73f087 ("block: remove support for the host aware zone model"), only ZBC devices expose a zoned access model. sd_is_zoned is used to check for that and thus return false for host aware devices. Replace the helper with the simple open coded TYPE_ZBC check to fix this. Fixes: 74

move features flags into queue_limits v2

2024-06-16 Thread Christoph Hellwig
Hi all, this is the third and last major series to convert settings to queue_limits for this merge window. After a bunch of prep patches to get various drivers in shape, it moves all the queue_flags that specify driver controlled features into the queue limits so that they can be set atomically a

Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-16 Thread Damien Le Moal
On 6/17/24 13:53, Christoph Hellwig wrote: > On Mon, Jun 17, 2024 at 08:01:04AM +0900, Damien Le Moal wrote: >> On 6/13/24 18:39, Christoph Hellwig wrote: >>> On Tue, Jun 11, 2024 at 02:51:24PM +0900, Damien Le Moal wrote: > + if (sdkp->device->type == TYPE_ZBC) Nit: use sd_is_zoned()

Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-16 Thread Christoph Hellwig
On Mon, Jun 17, 2024 at 08:01:04AM +0900, Damien Le Moal wrote: > On 6/13/24 18:39, Christoph Hellwig wrote: > > On Tue, Jun 11, 2024 at 02:51:24PM +0900, Damien Le Moal wrote: > >>> + if (sdkp->device->type == TYPE_ZBC) > >> > >> Nit: use sd_is_zoned() here ? > > > > Actually - is there much in e

Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-16 Thread Damien Le Moal
On 6/13/24 18:39, Christoph Hellwig wrote: > On Tue, Jun 11, 2024 at 02:51:24PM +0900, Damien Le Moal wrote: >>> + if (sdkp->device->type == TYPE_ZBC) >> >> Nit: use sd_is_zoned() here ? > > Actually - is there much in even keeping sd_is_zoned now that the > host aware support is removed? Just