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
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);
> > -
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 fe
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.
>
>
A friendly reminder that I've skipped over the full quote. Please
properly quote mails if you want your replies to be seen.
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 e
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
On Tue, Jun 11, 2024 at 02:58:56PM +0900, Damien Le Moal wrote:
> > + if (S_ISBLK(inode->i_mode))
> > + backing_bdev = I_BDEV(inode);
> > + else if (inode->i_sb->s_bdev)
> > + backing_bdev = inode->i_sb->s_bdev;
> > +
>
> Why not move this hunk inside the below "if" ?
On Tue, Jun 11, 2024 at 02:56:59PM +0900, Damien Le Moal wrote:
> > + if (!bsize)
> > + bsize = loop_default_blocksize(lo, inode->i_sb->s_bdev);
>
> If bsize is specified and there is a backing dev used with direct IO, should
> it
> be checked that bsize is a multiple of
On Tue, Jun 11, 2024 at 02:53:19PM +0900, Damien Le Moal wrote:
> > + /* reset the block size to the default */
> > + lim = queue_limits_start_update(lo->lo_queue);
> > + lim.logical_block_size = 512;
>
> Nit: SECTOR_SIZE ? maybe ?
Yes. I was following the existing code, but SECTOR_SIZE
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 already, no ?
>
> b
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)) {
> > + lim->zoned = false;
>
> Maybe we should
pointless.
Signed-off-by: Christoph Hellwig
---
block/blk-mq-debugfs.c| 1 -
block/blk-mq.c| 6 +-
block/blk-sysfs.c | 2 +-
drivers/md/dm-table.c | 12 +---
drivers/md/dm.c | 13 +++--
drivers/md/md.c
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(-)
diff --git a/block/blk-flush.c b/block/blk-flush.c
index
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
---
block/blk-mq-debugfs.c | 1 -
drivers/nvme/host/core.c | 8 +++-
include/linux/blkdev.h | 7 ---
3 files
on rotational devices even if that is
probably not their main use today (e.g. virtio_blk and drbd).
The flag is automatically inherited in blk_stack_limits matching the
existing behavior in dm and md.
Signed-off-by: Christoph Hellwig
---
arch/m68k/emu/nfblock.c | 1 +
arch/um/drivers
of the underlying devices.
Signed-off-by: Christoph Hellwig
---
block/blk-core.c | 5 ++--
block/blk-mq-debugfs.c| 1 -
block/blk-mq.c| 31 +++-
block/blk-settings.c | 10 ---
block/blk-sysfs.c | 4 +--
drivers/md/dm-table.c
devices.
Signed-off-by: Christoph Hellwig
---
block/blk-mq-debugfs.c | 1 -
block/blk-sysfs.c | 29 +
drivers/block/drbd/drbd_main.c | 5 ++---
drivers/block/rbd.c| 9 +++--
drivers/block/zram/zram_drv.c | 2 +-
drivers/md/dm
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
---
block/blk-mq-debugfs.c | 1 -
drivers/block/null_blk/zoned.c | 3 +--
drivers/block/ublk_drv.c | 4
Move the bounce field into the flags field to reclaim a little bit of
space.
Signed-off-by: Christoph Hellwig
---
block/blk-settings.c| 1 -
block/blk.h | 2 +-
drivers/scsi/scsi_lib.c | 2 +-
include/linux/blkdev.h | 6 --
4 files changed, 6 insertions(+), 5 deletions
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 +
1 file changed, 9 insertions(+), 20
of the underlying devices.
Signed-off-by: Christoph Hellwig
---
block/blk-mq-debugfs.c| 1 -
block/blk-mq.c| 2 +-
block/blk-settings.c | 9 +
drivers/block/brd.c | 4 ++--
drivers/md/dm-table.c | 16 ++--
drivers/md/md.c
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
---
block/blk-mq-debugfs.c| 1 -
drivers/block/brd.c | 2 +-
drivers/block/zram/zram_drv.c | 4
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 changed, 4 insertions(+), 19 deletions(-)
diff
Move the boolean zoned field into the flags field to reclaim a little
bit of space.
Signed-off-by: Christoph Hellwig
---
block/blk-settings.c | 5 ++---
drivers/block/null_blk/zoned.c | 2 +-
drivers/block/ublk_drv.c | 2 +-
drivers/block/virtio_blk.c | 5 +++--
drivers
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
---
block/blk-mq-debugfs.c | 1 -
drivers/nvme/host/core.c | 8 +---
include/linux/blkdev.h | 6 --
3
without the flag set.
Signed-off-by: Christoph Hellwig
---
block/blk-mq-debugfs.c| 1 -
block/blk-sysfs.c | 6 +++---
drivers/block/mtip32xx/mtip32xx.c | 1 -
drivers/md/dm-table.c | 18 --
drivers/mmc/core/queue.c | 2 --
drivers/mtd
is a pre-existing data integrity bug in those
targets that really needs fixing, after which a non-zero num_flush_bios
should be required in dm for targets that map to underlying devices.
Signed-off-by: Christoph Hellwig
---
.../block/writeback_cache_control.rst | 67 +++
arch
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
---
block/blk-mq-debugfs.c | 1 -
drivers/md/dm-table.c| 4 ++--
drivers/nvdimm/pmem.c| 7 ++-
drivers
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
---
block/blk-mq.c| 5 +++--
block/blk-sysfs.c
model")
Signed-off-by: Christoph Hellwig
---
drivers/scsi/sd.h | 7 ++-
drivers/scsi/sd_zbc.c | 7 +--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h
index 726f1613f6cb56..65dff3c2108926 100644
--- a/drivers/scsi/sd.h
+++
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 file changed, 3 insertions(+), 10 deletions
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
---
drivers/block/loop.c
__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 insertions(+), 1 deletion(-)
diff --git
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(-)
diff --git a/drivers/block/nbd.c b/drivers/block
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
---
drivers/block/loop.c | 8
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 | 10 --
1 file changed, 4 insertions
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 -
2 files changed, 13 insertions
On Fri, May 31, 2024 at 08:07:54AM -0400, Martin K. Petersen wrote:
> If you have other block layer changes depending on this series we'll
> probably need a shared branch. I'll need to make several changes to sd.c
> to fix reported issues, including a couple in the zeroing/discard
> department.
names to standard ones.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
---
drivers/scsi/sr.c | 42 +-
1 file changed, 25 insertions(+), 17 deletions(-)
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 7ab000942b97fc..3f491019103e0c
Remove all APIs that are unused now that sd and sr have been converted
to the atomic queue limits API.
Signed-off-by: Christoph Hellwig
Reviewed-by: Bart Van Assche
---
block/blk-settings.c | 190 -
include/linux/blkdev.h | 24 --
2 files changed
Assign all queue limits through a local queue_limits variable and
queue_limits_commit_update so that we can't race updating them from
multiple places, and freeze the queue when updating them so that
in-progress I/O submissions don't see half-updated limits.
Signed-off-by: Christoph Hellwig
locks or freeze the queue. Keep the existing clearing
of the relevant field to zero, but replace the old blk_queue_max_*
APIs with new disable APIs that force the value to 0.
Signed-off-by: Christoph Hellwig
Reviewed-by: Bart Van Assche
Reviewed-by: Damien Le Moal
---
arch/um/drivers/ubd_kern.c
Split the logic to pick the right discard mode into a little helper
to prepare for further changes.
Signed-off-by: Christoph Hellwig
Reviewed-by: Bart Van Assche
Reviewed-by: Damien Le Moal
---
drivers/scsi/sd.c | 37 -
1 file changed, 20 insertions(+), 17
-by: Christoph Hellwig
Reviewed-by: Bart Van Assche
Reviewed-by: Damien Le Moal
---
drivers/scsi/sd.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index f07d90474e682b..70211d0b187652 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi
Instead of a separate handler function that leaves no work in the
interrupt hanler itself, split out a per-request end I/O helper and
clean up the coding style and variable naming while we're at it.
Signed-off-by: Christoph Hellwig
---
arch/um/drivers/ubd_kern.c | 49
ize of any buffered read) and to prepare
for using io_opt in the max_sectors calculation and getting drivers out
of the business of overriding the max_user_sectors value.
Signed-off-by: Christoph Hellwig
---
drivers/block/rbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dri
Fall through to the main call to blk_queue_max_discard_sectors given that
max_blocks has been initialized to zero above instead of duplicating the
call.
Signed-off-by: Christoph Hellwig
Reviewed-by: Bart Van Assche
Reviewed-by: Damien Le Moal
---
drivers/scsi/sd.c | 3 +--
1 file changed, 1
Consolidate setting zone-related queue limits in sd_zbc_read_zones
instead of splitting them between sd_zbc_revalidate_zones and
sd_zbc_read_zones, and move the early_zone_information initialization
in sd_zbc_read_zones above setting up the queue limits.
Signed-off-by: Christoph Hellwig
Reviewed
to change this now.
Signed-off-by: Christoph Hellwig
Reviewed-by: Bart Van Assche
Reviewed-by: Damien Le Moal
---
drivers/scsi/sd.c | 9 -
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 3dff9150ce11e2..83aa17fea39d39 100644
Add helper to disable discard when it is not supported and use it
instead of sd_config_discard in the I/O completion handler. This avoids
touching more fields than required in the I/O completion handler and
prepares for converting sd to use the atomic queue limits API.
Signed-off-by: Christoph
big io_min value, but picks a much more useful
default for those who provide these hints, and allows to remove the
hacks to set the user max_sectors limit in nbd, rbd and sd.
Signed-off-by: Christoph Hellwig
Reviewed-by: Bart Van Assche
Reviewed-by: Damien Le Moal
---
block/blk-settings.c | 7
: Add support for DISCARD in the UBD Driver")
Signed-off-by: Christoph Hellwig
Reviewed-by: Bart Van Assche
Reviewed-by: Damien Le Moal
---
arch/um/drivers/ubd_kern.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/
Hi all,
this series converts the SCSI upper level drivers to the atomic queue
limits API.
The first patch is a bug fix for ubd that later patches depend on and
might be worth picking up for 6.10.
The second patch changes the max_sectors calculation to take the optimal
I/O size into account so
On Fri, May 31, 2024 at 08:48:12AM +0200, Ilya Dryomov wrote:
> We should revert io_opt from opts->alloc_size to objset_bytes (I think
> it's what you meant to say but typoed).
Yes, sorry.
> How do you want to handle it? I can put together a patch, send it to
> ceph-devel and it will be picked
On Thu, May 30, 2024 at 09:48:06PM +0200, Ilya Dryomov wrote:
> For rbd, this change effectively lowers max_sectors from 4M to 64K or
> less and that is definitely not desirable. From previous interactions
> with users we want max_sectors to match max_hw_sectors -- this has come
> up a quite a
On Thu, May 30, 2024 at 10:16:33AM +0100, John Garry wrote:
>> -static void sd_config_write_same(struct scsi_disk *);
>> +static void sd_config_discard(struct scsi_disk *sdkp, struct queue_limits
>> *lim,
>> +unsigned int mode);
>
> Are there any reasons why we keep forward
locks or freezer the queue. Keep the existing clearing
of the relevant field to zero, but replace the old blk_queue_max_*
APIs with new disable APIs that force the value to 0.
Signed-off-by: Christoph Hellwig
---
arch/um/drivers/ubd_kern.c | 5 ++---
block/blk-settings.c | 41
names to standard ones.
Signed-off-by: Christoph Hellwig
---
drivers/scsi/sr.c | 42 +-
1 file changed, 25 insertions(+), 17 deletions(-)
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 7ab000942b97fc..3f491019103e0c 100644
--- a/drivers/scsi/sr.c
Remove all APIs that are unused now that sd and sr have been converted
to the atomic queue limits API.
Signed-off-by: Christoph Hellwig
---
block/blk-settings.c | 190 -
include/linux/blkdev.h | 12 ---
2 files changed, 202 deletions(-)
diff --git
Consolidate setting zone-related queue limits in sd_zbc_read_zones
instead of splitting them between sd_zbc_revalidate_zones and
sd_zbc_read_zones, and move the early_zone_information initialization
in sd_zbc_read_zones above setting up the queue limits.
Signed-off-by: Christoph Hellwig
Fall through to the main call to blk_queue_max_discard_sectors given that
max_blocks has been initialized to zero above instead of duplicating the
call.
Signed-off-by: Christoph Hellwig
---
drivers/scsi/sd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/sd.c
: Add support for DISCARD in the UBD Driver")
Signed-off-by: Christoph Hellwig
---
arch/um/drivers/ubd_kern.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index ef805eaa9e013d..a79a3b7c33a647 100644
---
Add helper to disable discard when it is not supported and use it
instead of sd_config_discard in the I/O completion handler. This avoids
touching more fields than required in the I/O completion handler and
prepares for converting sd to use the atomic queue limits API.
Signed-off-by: Christoph
Assign all queue limits through a local queue_limits variable and
queue_limits_commit_update so that we can't race updating them from
multiple places, and free the queue when updating them so that
in-progress I/O submissions don't see half-updated limits.
Signed-off-by: Christoph Hellwig
Hi all,
this series converts the SCSI upper level drivers to the atomic queue
limits API.
The first patch is a bug fix for ubd that later patches depend on and
might be worth picking up for 6.10.
The second patch changes the max_sectors calculation to take the optimal
I/O size into account so
Split the logic to pick the right discard mode into a little helper
to prepare for further changes.
Signed-off-by: Christoph Hellwig
---
drivers/scsi/sd.c | 37 -
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi
change that
could use careful review from people familiar with rbd.
Signed-off-by: Christoph Hellwig
---
block/blk-settings.c | 7 +++
drivers/block/nbd.c | 2 +-
drivers/block/rbd.c | 1 -
drivers/scsi/sd.c| 29 +
4 files changed, 13 insertions(+), 26
-by: Christoph Hellwig
---
drivers/scsi/sd.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index a8838381823254..09ffe9d826aeac 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1004,6 +1004,13 @@ static blk_status_t
to change this now.
Signed-off-by: Christoph Hellwig
---
drivers/scsi/sd.c | 9 -
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 3dff9150ce11e2..15d0035048d902 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -461,14 +461,13
On Sun, Apr 07, 2024 at 09:11:42PM -0700, mhkelle...@gmail.com wrote:
> I've wondered if this code for zero'ing the pre- and post-padding
> should go in swiotlb_tbl_map_single(). The bounce buffer proper is
> already being initialized there. But swiotlb_tbl_map_single()
> would need to test for an
I'd still prefer to hide the vm_area, but for now:
Reviewed-by: Christoph Hellwig
On Tue, Feb 27, 2024 at 05:31:28PM -0800, Alexei Starovoitov wrote:
> What would it look like with a cookie?
> A static inline wrapper around get_vm_area() that returns area->addr ?
> And the start address of vmap range will be such a cookie?
Hmm, just making the kernel virtual address the cookie
> privately-managed pages into a sparse vm area with the following steps:
>
> area = get_vm_area(area_size, VM_SPARSE); // at bpf prog verification time
> vm_area_map_pages(area, kaddr, 1, page); // on demand
> // it will return an error if kaddr is out of range
>
Jens,
can you pick this up with the Xen maintainer review in place?
On Fri, Feb 23, 2024 at 03:57:27PM -0800, Alexei Starovoitov wrote:
> From: Alexei Starovoitov
>
> xen grant table and xenbus ring are not ioremap the way arch specific code is
> using it,
> so let's add VM_XEN flag to separate them from VM_IOREMAP users.
> xen will not and should not be
() matches created vm_area to avoid accidentally ioremap-ing
> into wrong address range.
Nit: overly long lines in the commit message here.
Otherwise looks good:
Reviewed-by: Christoph Hellwig
Pass the initial queue limits to blk_mq_alloc_disk and use the
blkif_set_queue_limits API to update the limits on reconnect.
Signed-off-by: Christoph Hellwig
Acked-by: Roger Pau Monné
---
drivers/block/xen-blkfront.c | 41
1 file changed, 23 insertions
The block layer now sets the discard granularity to the physical
block size default. Take advantage of that in xen-blkfront and only
set the discard granularity if explicitly specified.
Signed-off-by: Christoph Hellwig
Acked-by: Roger Pau Monné
---
drivers/block/xen-blkfront.c | 4 ++--
1
Hi all,
this series converts xen-blkfront to the new atomic queue limits update
API in the block tree. I don't have a Xen setup so this is compile
tested only.
Changes since v1:
- constify the info argument to blkif_set_queue_limits
- remove a spurious word from a commit message
Diffstat:
blkif_set_queue_limits already sets the max_sements limits, so don't do
it a second time. Also remove a comment about a long fixe bug in
blk_mq_update_nr_hw_queues.
Signed-off-by: Christoph Hellwig
Acked-by: Roger Pau Monné
---
drivers/block/xen-blkfront.c | 8 +++-
1 file changed, 3
Currently xen-blkfront set the max discard limit to the capacity of
the device, which is suboptimal when the capacity changes. Just set
it to UINT_MAX, which has the same effect and is simpler.
Signed-off-by: Christoph Hellwig
Acked-by: Roger Pau Monné
---
drivers/block/xen-blkfront.c | 6
On Tue, Feb 20, 2024 at 01:35:07PM +0100, Roger Pau Monné wrote:
> On Tue, Feb 20, 2024 at 09:49:35AM +0100, Christoph Hellwig wrote:
> > Pass the initial queue limits to blk_mq_alloc_disk and use the
> > blkif_set_queue_limits API to update the limits on reconnect.
>
> Al
On Tue, Feb 20, 2024 at 12:39:59PM +0100, Roger Pau Monné wrote:
> On Tue, Feb 20, 2024 at 09:49:32AM +0100, Christoph Hellwig wrote:
> > Currently xen-blkfront set the max discard limit to the capacity of
> > the device, which is suboptimal when the capacity changes. Just set
>
Pass the initial queue limits to blk_mq_alloc_disk and use the
blkif_set_queue_limits API to update the limits on reconnect.
Signed-off-by: Christoph Hellwig
---
drivers/block/xen-blkfront.c | 41
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git
blkif_set_queue_limits already sets the max_sements limits, so don't do
it a second time. Also remove a comment about a long fixe bug in
blk_mq_update_nr_hw_queues.
Signed-off-by: Christoph Hellwig
---
drivers/block/xen-blkfront.c | 8 +++-
1 file changed, 3 insertions(+), 5 deletions
Currently xen-blkfront set the max discard limit to the capacity of
the device, which is suboptimal when the capacity changes. Just set
it to UINT_MAX, which has the same effect except and is simpler.
Signed-off-by: Christoph Hellwig
---
drivers/block/xen-blkfront.c | 6 ++
1 file changed
The block layer now sets the discard granularity to the physical
block size default. Take advantage of that in xen-blkfront and only
set the discard granularity if explicitly specified.
Signed-off-by: Christoph Hellwig
---
drivers/block/xen-blkfront.c | 4 ++--
1 file changed, 2 insertions
Hi all,
this series converts xen-blkfront to the new atomic queue limits update
API in the block tree. I don't have a Xen setup so this is compile
tested only.
Diffstat:
xen-blkfront.c | 53 +++--
1 file changed, 27 insertions(+), 26
On Thu, Jan 04, 2024 at 12:28:55PM +0100, Jan Kara wrote:
> What do you think? Because when we are working with the folios it is rather
> natural to use their mapping for dirty balancing?
The real problem is that block2mtd pokes way to deep into block
internals.
I think the saviour here is
On Thu, Jan 04, 2024 at 12:06:31PM +0100, Jan Kara wrote:
> This function uses invalidate_inode_pages2() while invalidate_bdev() ends
> up using mapping_try_invalidate() and there are subtle behavioral
> differences between these two (for example invalidate_inode_pages2() tries
> to clean dirty
On Mon, Dec 11, 2023 at 10:07:53PM +0800, Yu Kuai wrote:
> +static __always_inline int buffer_uptodate_or_error(struct buffer_head *bh)
> +{
> + /*
> + * If the buffer has the write error flag, data was failed to write
> + * out in the block. In this case, set buffer uptodate to
Looks good:
Reviewed-by: Christoph Hellwig
> +void invalidate_bdev_range(struct block_device *bdev, pgoff_t start,
> +pgoff_t end)
> +{
> + invalidate_mapping_pages(bdev->bd_inode->i_mapping, start, end);
> +}
> +EXPORT_SYMBOL_GPL(invalidate_bdev_range);
Can we have kerneldoc comments for the new helpers
On Mon, Dec 11, 2023 at 05:52:17PM +0100, Jan Kara wrote:
> > +void bdev_associated_mapping(struct block_device *bdev,
> > +struct address_space *mapping)
> > +{
> > + mapping->host = bdev->bd_inode;
> > +}
>
> Here I'm not sure - is the helper really a win? It seems a
On Wed, Dec 06, 2023 at 12:50:38PM -0500, Theodore Ts'o wrote:
> This was added because pulling a mounted a USB thumb drive (or a HDD
> drops off the SATA bus) while the file system is mounted and actively
> in use, would result in a kernel OOPS. If that's no longer true,
> that's great, but it
On Wed, Dec 06, 2023 at 02:56:05PM +0800, Yu Kuai wrote:
> > > - invalidate_inode_pages2(
> > > - blkif->vbd.bdev_handle->bdev->bd_inode->i_mapping);
> > > + invalidate_bdev(blkif->vbd.bdev_handle->bdev);
> >
> > blkbak is a bdev exported. I don't think it should ever call
> >
On Wed, Dec 06, 2023 at 02:50:56PM +0800, Yu Kuai wrote:
> I'm a litter confused, so there are 3 use cases:
> 1) use GFP_USER, default gfp from bdev_alloc.
> 2) use GFP_KERNEL
> 3) use GFP_NOFS
>
> I understand that you're suggesting memalloc_nofs_save() to distinguish
> 2 and 3, but how can I
> +void invalidate_bdev_range(struct block_device *bdev, pgoff_t start,
> +pgoff_t end)
> +{
> + invalidate_mapping_pages(bdev->bd_inode->i_mapping, start, end);
> +}
> +EXPORT_SYMBOL_GPL(invalidate_bdev_range);
All these could probably use kerneldoc comments.
For
On Tue, Dec 05, 2023 at 08:37:16PM +0800, Yu Kuai wrote:
> diff --git a/drivers/block/xen-blkback/xenbus.c
> b/drivers/block/xen-blkback/xenbus.c
> index e34219ea2b05..e645afa4af57 100644
> --- a/drivers/block/xen-blkback/xenbus.c
> +++ b/drivers/block/xen-blkback/xenbus.c
> @@ -104,8 +104,7 @@
1 - 100 of 1107 matches
Mail list logo