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

2024-06-11 Thread Christoph Hellwig
On Tue, Jun 11, 2024 at 05:21:07PM +0900, Damien Le Moal wrote: > Kind of the same remark as for io_stat about this not really being a device > feature. But I guess seeing "features" as a queue feature rather than just a > device feature makes it OK to have poll (and io_stat) as a feature rather th

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

2024-06-11 Thread Christoph Hellwig
On Tue, Jun 11, 2024 at 05:16:37PM +0900, Damien Le Moal wrote: > > @@ -1825,9 +1815,7 @@ int dm_table_set_restrictions(struct dm_table *t, > > struct request_queue *q, > > int r; > > > > if (dm_table_supports_nowait(t)) > > - blk_queue_flag_set(QUEUE_FLAG_NOWAIT, q); > > - e

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

2024-06-11 Thread Christoph Hellwig
On Tue, Jun 11, 2024 at 05:09:45PM +0900, Damien Le Moal wrote: > On 6/11/24 2:19 PM, Christoph Hellwig wrote: > > Move the io_stat flag into the queue_limits feature field so that it > > can be set atomically and all I/O is frozen when changing the flag. > > Why a feature ? It seems more appropri

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

2024-06-11 Thread Christoph Hellwig
On Tue, Jun 11, 2024 at 04:55:04PM +0900, Damien Le Moal wrote: > On 6/11/24 2:19 PM, Christoph Hellwig wrote: > > Move the cache control settings into the queue_limits so that they > > can be set atomically and all I/O is frozen when changing the > > flags. > > ...so that they can be set atomical

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

2024-06-11 Thread Christoph Hellwig
A friendly reminder that I've skipped over the full quote. Please properly quote mails if you want your replies to be seen.

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

2024-06-11 Thread Christoph Hellwig
On Tue, Jun 11, 2024 at 04:30:39PM +0900, Damien Le Moal wrote: > On 6/11/24 2:19 PM, Christoph Hellwig wrote: > > blkfront always had a robust negotiation protocol for detecting a write > > cache. Stop simply disabling cache flushes when they fail as that is > > a grave error. > > > > Signed-off

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

2024-06-11 Thread Christoph Hellwig
On Tue, Jun 11, 2024 at 02:51:24PM +0900, Damien Le Moal wrote: > > - if (!sd_is_zoned(sdkp)) > > + if (!sd_is_zoned(sdkp)) { > > + lim->zoned = false; > > Maybe we should clear the other zone related limits here ? If the drive is > reformatted/converted from SMR to CMR (FORMAT WITH

Re: [PATCH] arch: um: rust: Use the generated target.json again

2024-06-11 Thread Miguel Ojeda
On Wed, May 29, 2024 at 11:33 AM David Gow wrote: > > The Rust compiler can take a target config from 'target.json', which is > generated by scripts/generate_rust_target.rs. It used to be that all > Linux architectures used this to generate a target.json, but now > architectures must opt-in to thi

Re: [PATCH] hostfs: Add const qualifier to host_root in hostfs_fill_super()

2024-06-11 Thread Richard Weinberger
- Ursprüngliche Mail - > Von: "Nathan Chancellor" > An: "Christian Brauner" > CC: "Hongbo Li" , "richard" , "anton > ivanov" , > "Johannes Berg" , "linux-um" > , "linux-kernel" > , "Nathan Chancellor" > Gesendet: Dienstag, 11. Juni 2024 21:58:41 > Betreff: [PATCH] hostfs: Add const qua

[PATCH] hostfs: Add const qualifier to host_root in hostfs_fill_super()

2024-06-11 Thread Nathan Chancellor
;s_fs_info; + const char *host_root = fc->source; struct inode *root_inode; - char *host_root = fc->source; int err; sb->s_blocksize = 1024; --- base-commit: cd140ce9f611a5e9d2a5989a282b75e55c71dab3 change-id: 20240611-hostfs-fix-mount-api-conversion-83eda29c74fe Best regards, -- Nathan Chancellor

Re: [PATCH 12/26] block: remove blk_flush_policy

2024-06-11 Thread Bart Van Assche
On 6/10/24 10:19 PM, Christoph Hellwig wrote: Fold blk_flush_policy into the only caller to prepare for pending changes to it. Reviewed-by: Bart Van Assche

Re: [PATCH 11/26] block: freeze the queue in queue_attr_store

2024-06-11 Thread Bart Van Assche
On 6/10/24 10:19 PM, Christoph Hellwig wrote: queue_attr_store updates attributes used to control generating I/O, and can cause malformed bios if changed with I/O in flight. Freeze the queue in common code instead of adding it to almost every attribute. Reviewed-by: Bart Van Assche

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

2024-06-11 Thread Bart Van Assche
On 6/10/24 10:19 PM, Christoph Hellwig wrote: Move setting the cache control flags in nbd in preparation for moving these flags into the queue_limits structure. Reviewed-by: Bart Van Assche

Re: [PATCH 08/26] virtio_blk: remove virtblk_update_cache_mode

2024-06-11 Thread Bart Van Assche
On 6/10/24 10:19 PM, Christoph Hellwig wrote: 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. Reviewed-by: Bart Van Assche

Re: [PATCH 07/26] loop: fold loop_update_rotational into loop_reconfigure_limits

2024-06-11 Thread Bart Van Assche
On 6/10/24 10:19 PM, Christoph Hellwig wrote: 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. Reviewed-by: Bart Van Assche

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

2024-06-11 Thread Bart Van Assche
On 6/10/24 10:19 PM, 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. Reviewed-by: Bart

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

2024-06-11 Thread Bart Van Assche
On 6/10/24 10:19 PM, 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. Reviewed-by

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

2024-06-11 Thread Bart Van Assche
On 6/10/24 10:19 PM, Christoph Hellwig wrote: 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. Reviewed-by: Bart Van Assche

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

2024-06-11 Thread Bart Van Assche
On 6/10/24 10:19 PM, Christoph Hellwig wrote: __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. If Damien's comment is addressed, feel free to add: Reviewed-by: Bart Van Assche

Re: [PATCH 01/26] sd: fix sd_is_zoned

2024-06-11 Thread Bart Van Assche
On 6/10/24 10:19 PM, Christoph Hellwig wrote: 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. Reviewed-by: Bart Van Assche

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

2024-06-11 Thread Josef Bacik
On Tue, Jun 11, 2024 at 07:19:09AM +0200, Christoph Hellwig wrote: > 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: Josef Bacik Thanks, Josef

Re: [PATCH 08/26] virtio_blk: remove virtblk_update_cache_mode

2024-06-11 Thread Stefan Hajnoczi
On Tue, Jun 11, 2024 at 07:19:08AM +0200, Christoph Hellwig wrote: > 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 > --- > drivers/block/

Re: [PATCH 01/26] sd: fix sd_is_zoned

2024-06-11 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn

Re: [PATCH 08/26] virtio_blk: remove virtblk_update_cache_mode

2024-06-11 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn

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

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, Christoph Hellwig wrote: Move the cache control settings into the queue_limits so that they can be set atomically and all I/O is frozen when changing the flags. Add new features and flags field for the driver set flags, and internal (usually sysfs-controlled) flags in the block

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the bounce field into the flags field to reclaim a little bit of s/flags/feature > space. > > Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the skip_tagset_quiesce flag into the queue_limits feature field so > that it can be set atomically and all I/O is frozen when changing the > flag. > > Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal -- Damien Le Moal Western Di

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the pci_p2pdma flag into the queue_limits feature field so that it > can be set atomically and all I/O is frozen when changing the flag. > > Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Resea

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the zone_resetall flag into the queue_limits feature field so that > it can be set atomically and all I/O is frozen when changing the flag. > > Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Re

Re: [PATCH 12/26] block: remove blk_flush_policy

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, Christoph Hellwig wrote: Fold blk_flush_policy into the only caller to prepare for pending changes to it. Signed-off-by: Christoph Hellwig --- block/blk-flush.c | 33 +++-- 1 file changed, 15 insertions(+), 18 deletions(-) Reviewed-by: Hannes R

Re: [PATCH 22/26] block: move the zoned flag into the feature field

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the boolean zoned field into the flags field to reclaim a little > bit of space. Nit: flags -> feature flags > > Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research

Re: [PATCH 11/26] block: freeze the queue in queue_attr_store

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, Christoph Hellwig wrote: queue_attr_store updates attributes used to control generating I/O, and can cause malformed bios if changed with I/O in flight. Freeze the queue in common code instead of adding it to almost every attribute. Signed-off-by: Christoph Hellwig --- bloc

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

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, Christoph Hellwig wrote: blkfront always had a robust negotiation protocol for detecting a write cache. Stop simply disabling cache flushes when they fail as that is a grave error. Signed-off-by: Christoph Hellwig --- drivers/block/xen-blkfront.c | 29 +-

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the poll flag into the queue_limits feature field so that it > can be set atomically and all I/O is frozen when changing the flag. > > Stacking drivers are simplified in that they now can simply set the > flag, and blk_stack_limits will clear it

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

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, Christoph Hellwig wrote: Move setting the cache control flags in nbd in preparation for moving these flags into the queue_limits structure. Signed-off-by: Christoph Hellwig --- drivers/block/nbd.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) Re

Re: [PATCH 08/26] virtio_blk: remove virtblk_update_cache_mode

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, Christoph Hellwig wrote: 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 --- drivers/block/virtio_blk.c | 13 +++-- 1

Re: [PATCH 07/26] loop: fold loop_update_rotational into loop_reconfigure_limits

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, Christoph Hellwig wrote: 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 --- drivers/block/loop.c | 23 --- 1 file chang

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

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, 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-by: Christo

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the dax flag into the queue_limits feature field so that it > can be set atomically and all I/O is frozen when changing the flag. > > Signed-off-by: Christoph Hellwig Looks good. Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital

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

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, 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. Signed-off-by:

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the nowait flag into the queue_limits feature field so that it > can be set atomically and all I/O is frozen when changing the flag. > > Stacking drivers are simplified in that they now can simply set the > flag, and blk_stack_limits will clear i

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

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, Christoph Hellwig wrote: 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 --- drivers/block/loop.c |

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

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, Christoph Hellwig wrote: __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 --- drivers/block/loop.c | 10 +- 1 file changed, 9 ins

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the synchronous flag into the queue_limits feature field so that it > can be set atomically and all I/O is frozen when changing the flag. > > Signed-off-by: Christoph Hellwig Looks good. Reviewed-by: Damien Le Moal -- Damien Le Moal Western

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the io_stat flag into the queue_limits feature field so that it can s/io_stat/stable_write > be set atomically and all I/O is frozen when changing the flag. > > The flag is now inherited by blk_stack_limits, which greatly simplifies > the code

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

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, Christoph Hellwig wrote: 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 | 13

Re: [PATCH 01/26] sd: fix sd_is_zoned

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, Christoph Hellwig wrote: 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. Fixes: 7437bb73f087 ("block: remove sup

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the io_stat flag into the queue_limits feature field so that it > can be set atomically and all I/O is frozen when changing the flag. Why a feature ? It seems more appropriate for io_stat to be a flag rather than a feature as that is a block laye

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the add_random flag into the queue_limits feature field so that it > can be set atomically and all I/O is frozen when changing the flag. Same remark as the previous patches for the end of this sentence.c > > Note that this also removes code fro

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the norot flag into the queue_limits feature field so that it can be s/norot/nonrot > set atomically and all I/O is frozen when changing the flag. and... -> with the queue frozen when... ? > > Use the chance to switch to defaulting to non-rot

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move the cache control settings into the queue_limits so that they > can be set atomically and all I/O is frozen when changing the > flags. ...so that they can be set atomically with the device queue frozen when changing the flags. may be better. >

Re: [PATCH 12/26] block: remove blk_flush_policy

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Fold blk_flush_policy into the only caller to prepare for pending changes > to it. > > Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research

Re: [PATCH 11/26] block: freeze the queue in queue_attr_store

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > queue_attr_store updates attributes used to control generating I/O, and > can cause malformed bios if changed with I/O in flight. Freeze the queue > in common code instead of adding it to almost every attribute. > > Signed-off-by: Christoph Hellwig

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > blkfront always had a robust negotiation protocol for detecting a write > cache. Stop simply disabling cache flushes when they fail as that is > a grave error. > > Signed-off-by: Christoph Hellwig Looks good to me but maybe mention that removal of

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > 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: Damien Le Moal -- Damien Le Moal Western Digital Research

Re: [PATCH 08/26] virtio_blk: remove virtblk_update_cache_mode

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > 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: Damien Le Moal -- Damien Le

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:54 PM, Christoph Hellwig wrote: > On Tue, Jun 11, 2024 at 07:52:39AM +0200, Christoph Hellwig wrote: >>> Maybe we should clear the other zone related limits here ? If the drive is >>> reformatted/converted from SMR to CMR (FORMAT WITH PRESET), the other zone >>> limits may be set alrea

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

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:52 PM, Christoph Hellwig wrote: > On Tue, Jun 11, 2024 at 02:51:24PM +0900, Damien Le Moal wrote: >>> - if (lim->zoned) >>> + if (sdkp->device->type == TYPE_ZBC) >> >> Nit: use sd_is_zoned() here ? > > Yes. > >>> - if (!sd_is_zoned(sdkp)) >>> + if (!sd_is_zoned(sdkp)) { >>> +