Re: [dm-devel] [PATCH v7 0/6] block: Introduce REQ_ALLOCATE flag for REQ_OP_WRITE_ZEROES

2020-03-19 Thread Christoph Hellwig
On Fri, Mar 13, 2020 at 04:08:58PM +0300, Kirill Tkhai wrote: > I just don't understand the reason nothing happens :( > I see newly-sent patches comes fast into block tree. > But there is only silence... I grepped over Documentation, > and there is no special rules about block tree. So, > it looks

Re: [dm-devel] [PATCH 06/14] block: lift setting the readahead size into the block layer

2020-09-02 Thread Christoph Hellwig
On Wed, Aug 26, 2020 at 06:07:38PM -0400, Mike Snitzer wrote: > On Sun, Jul 26 2020 at 11:03am -0400, > Christoph Hellwig wrote: > > > Drivers shouldn't really mess with the readahead size, as that is a VM > > concept. Instead set it based on the optimal I/O size by lift

Re: [dm-devel] [PATCH 06/14] block: lift setting the readahead size into the block layer

2020-09-10 Thread Christoph Hellwig
On Wed, Sep 02, 2020 at 12:20:07PM -0400, Mike Snitzer wrote: > On Wed, Sep 02 2020 at 11:11am -0400, > Christoph Hellwig wrote: > > > On Wed, Aug 26, 2020 at 06:07:38PM -0400, Mike Snitzer wrote: > > > On Sun, Jul 26 2020 at 11:03am -0400, > > > Christoph Hellw

Re: [dm-devel] clean up is partition checks

2020-09-14 Thread Christoph Hellwig
Jens, can you pick this series up? -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 06/14] block: lift setting the readahead size into the block layer

2020-09-15 Thread Christoph Hellwig
On Thu, Sep 10, 2020 at 01:15:41PM -0400, Mike Snitzer wrote: > > I'll move it to blk_register_queue, which should work just fine. > > That'll work for initial DM table load as part of DM device creation > (dm_setup_md_queue). But it won't account for DM table reloads that > might change

[dm-devel] [PATCH 08/12] bdi: remove BDI_CAP_SYNCHRONOUS_IO

2020-09-15 Thread Christoph Hellwig
ort ->rw_page and those who don't. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/block/brd.c | 1 - drivers/block/zram/zram_drv.c | 19 +-- drivers/nvdimm/btt.c | 2 -- drivers/nvdimm/pmem.c | 1 - include/linux/backing

[dm-devel] [PATCH 12/12] bdi: replace BDI_CAP_NO_{WRITEBACK, ACCT_DIRTY} with a single flag

2020-09-15 Thread Christoph Hellwig
Replace the two negative flags that are always used together with a single positive flag that indicates the writeback capability instead of two related non-capabilities. Also remove the pointless wrappers to just check the flag. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn

[dm-devel] [PATCH 01/12] fs: remove the unused SB_I_MULTIROOT flag

2020-09-15 Thread Christoph Hellwig
The last user of SB_I_MULTIROOT is disappeared with commit f2aedb713c28 ("NFS: Add fs_context support.") Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- fs/namei.c | 4 ++-- include/linux/fs.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff

[dm-devel] [PATCH 05/12] md: update the optimal I/O size on reshape

2020-09-15 Thread Christoph Hellwig
The raid5 and raid10 drivers currently update the read-ahead size, but not the optimal I/O size on reshape. To prepare for deriving the read-ahead size from the optimal I/O size make sure it is updated as well. Signed-off-by: Christoph Hellwig Acked-by: Song Liu Reviewed-by: Johannes Thumshirn

[dm-devel] [PATCH 06/12] block: lift setting the readahead size into the block layer

2020-09-15 Thread Christoph Hellwig
off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- block/blk-settings.c | 5 ++--- block/blk-sysfs.c| 10 +- block/genhd.c| 5 +++-- drivers/block/aoe/aoeblk.c | 2 -- drivers/block/drbd/drbd_nl.c | 12 +--- drivers/md/bcache/supe

[dm-devel] bdi cleanups v5

2020-09-15 Thread Christoph Hellwig
Hi Jens, this series contains a bunch of different BDI cleanups. The biggest item is to isolate block drivers from the BDI in preparation of changing the lifetime of the block device BDI in a follow up series. Changes since v4: - add a back a prematurely removed assignment in dm-table.c -

[dm-devel] [PATCH 10/12] bdi: replace BDI_CAP_STABLE_WRITES with a queue and a sb flag

2020-09-15 Thread Christoph Hellwig
for easier testing. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- block/blk-integrity.c | 4 ++-- block/blk-mq-debugfs.c| 1 + block/blk-sysfs.c | 3 +++ drivers/block/rbd.c | 2 +- drivers/block/zram/zram_drv.c | 2 +- drivers/md/dm

[dm-devel] [PATCH 03/12] drbd: remove RB_CONGESTED_REMOTE

2020-09-15 Thread Christoph Hellwig
This case isn't ever used. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/block/drbd/drbd_req.c | 4 include/linux/drbd.h | 1 - 2 files changed, 5 deletions(-) diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index

[dm-devel] [PATCH 02/12] drbd: remove dead code in device_to_statistics

2020-09-15 Thread Christoph Hellwig
Ever since the switch to blk-mq, a lower device not used for VM writeback will not be marked congested, so the check will never trigger. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/block/drbd/drbd_nl.c | 6 -- 1 file changed, 6 deletions(-) diff --git

[dm-devel] [PATCH 09/12] mm: use SWP_SYNCHRONOUS_IO more intelligently

2020-09-15 Thread Christoph Hellwig
There is no point in trying to call bdev_read_page if SWP_SYNCHRONOUS_IO is not set, as the device won't support it. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- mm/page_io.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mm

[dm-devel] [PATCH 04/12] bdi: initialize ->ra_pages and ->io_pages in bdi_init

2020-09-15 Thread Christoph Hellwig
Set up a readahead size by default, as very few users have a good reason to change it. Signed-off-by: Christoph Hellwig Acked-by: David Sterba [btrfs] Acked-by: Richard Weinberger [ubifs, mtd] --- block/blk-core.c | 2 -- drivers/mtd/mtdcore.c | 2 ++ fs/9p/vfs_super.c | 6 -- fs

[dm-devel] [PATCH 07/12] bdi: remove BDI_CAP_CGROUP_WRITEBACK

2020-09-15 Thread Christoph Hellwig
Just checking SB_I_CGROUPWB for cgroup writeback support is enough. Either the file system allocates its own bdi (e.g. btrfs), in which case it is known to support cgroup writeback, or the bdi comes from the block layer, which always supports cgroup writeback. Signed-off-by: Christoph Hellwig

[dm-devel] [PATCH 11/12] bdi: invert BDI_CAP_NO_ACCT_WB

2020-09-15 Thread Christoph Hellwig
Replace BDI_CAP_NO_ACCT_WB with a positive BDI_CAP_WRITEBACK_ACCT to make the checks more obvious. Also remove the pointless bdi_cap_account_writeback wrapper that just obsfucates the check. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- fs/fuse/inode.c | 3

[dm-devel] [PATCH 1/9] Documentation/hdio: fix up obscure bd_contains references

2020-09-03 Thread Christoph Hellwig
bd_contains is an implementation detail and should not be mentioned in a userspace API documentation. Signed-off-by: Christoph Hellwig --- Documentation/userspace-api/ioctl/hdio.rst | 24 +++--- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Documentation

[dm-devel] [PATCH 5/9] drbd: don't detour through bd_contains for the gendisk

2020-09-03 Thread Christoph Hellwig
bd_disk is set on all block devices, including those for partitions. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_receiver.c | 2 +- drivers/block/drbd/drbd_worker.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver.c b

[dm-devel] [PATCH 6/9] drbd: don't set ->bd_contains

2020-09-03 Thread Christoph Hellwig
The ->bd_contains field is set by __blkdev_get and drivers have no business manipulating it. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c in

[dm-devel] [PATCH 9/9] vsprintf: use bd_partno in bdev_name

2020-09-03 Thread Christoph Hellwig
No need to go through the hd_struct to find the partition number. Signed-off-by: Christoph Hellwig --- lib/vsprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index afb9521ddf9197..14c9a6af1b239a 100644 --- a/lib/vsprintf.c +++ b

[dm-devel] [PATCH 3/9] md: compare bd_disk instead of bd_contains

2020-09-03 Thread Christoph Hellwig
To check for partitions of the same disk bd_contains works as well, but bd_disk is way more obvious. Signed-off-by: Christoph Hellwig --- drivers/md/md.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 9562ef598ae1f4

[dm-devel] [PATCH 4/9] md: don't detour through bd_contains for the gendisk

2020-09-03 Thread Christoph Hellwig
bd_disk is set on all block devices, including those for partitions. Signed-off-by: Christoph Hellwig --- drivers/md/md.c | 2 +- drivers/md/md.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 3f33562d10d6f5..5a0fd93769a70e 100644

[dm-devel] [PATCH 8/9] block: use bd_partno in bdevname

2020-09-03 Thread Christoph Hellwig
No need to go through the hd_struct to find the partition number. Signed-off-by: Christoph Hellwig --- block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/genhd.c b/block/genhd.c index 081f1039d9367f..771aa56b1a8c3d 100644 --- a/block/genhd.c +++ b/block

[dm-devel] [PATCH 7/9] target/iblock: fix holder printing in iblock_show_configfs_dev_params

2020-09-03 Thread Christoph Hellwig
bd_contains is never NULL for an open block device. In addition ibd_bd is always set to a block device that was exclusively opened by the target code, so the holder is guranteed to be ib_dev as well. Signed-off-by: Christoph Hellwig --- drivers/target/target_core_iblock.c | 5 ++--- 1 file

[dm-devel] [PATCH 5/9] block: use revalidate_disk_size in set_capacity_revalidate_and_notify

2020-09-03 Thread Christoph Hellwig
Only virtio_blk and xen-blkfront set the revalidate argument to true, and both do not implement the ->revalidate_disk method. So switch to the helper that just updates the size instead. Signed-off-by: Christoph Hellwig --- block/genhd.c | 7 +++ include/linux/genhd.h | 4 ++--

[dm-devel] [PATCH 2/9] block: add a bdev_is_partition helper

2020-09-03 Thread Christoph Hellwig
Add a littler helper to make the somewhat arcane bd_contains checks a little more obvious. Signed-off-by: Christoph Hellwig --- block/blk-lib.c | 2 +- block/ioctl.c | 4 ++-- block/scsi_ioctl.c | 2 +- drivers/ide/ide-ioctls.c| 4

[dm-devel] clean up is partition checks

2020-09-03 Thread Christoph Hellwig
Hi Jens, this series add a new helepr to check if a struct block_device represents a parition, and removes most direct access to ->bd_contained from drivers. Diffstat: Documentation/userspace-api/ioctl/hdio.rst | 24 block/blk-lib.c|2

Re: [dm-devel] [PATCH 2/9] block: add a bdev_is_partition helper

2020-09-03 Thread Christoph Hellwig
On Thu, Sep 03, 2020 at 10:19:34AM +0200, Ulf Hansson wrote: > On Thu, 3 Sep 2020 at 07:42, Christoph Hellwig wrote: > > > > Add a littler helper to make the somewhat arcane bd_contains checks a > > little more obvious. > > > > Signed-off-by: Christoph Hellwi

[dm-devel] [PATCH 8/9] nvdimm: simplify revalidate_disk handling

2020-09-01 Thread Christoph Hellwig
, and remove the revalidate_disk methods given that it can only be triggered from add_disk, which is right before the manual calls. Signed-off-by: Christoph Hellwig --- drivers/nvdimm/blk.c | 3 +-- drivers/nvdimm/btt.c | 3 +-- drivers/nvdimm/bus.c | 9 +++-- drivers/nvdimm/nd.h | 2 +- drivers

[dm-devel] remove revalidate_disk()

2020-09-01 Thread Christoph Hellwig
Hi Jens, this series removes the revalidate_disk() function, which has been a really odd duck in the last years. The prime reason why most people use it is because it propagates a size change from the gendisk to the block_device structure. But it also calls into the rather ill defined

[dm-devel] [PATCH 7/9] sd: open code revalidate_disk

2020-09-01 Thread Christoph Hellwig
Instead of calling revalidate_disk just do the work directly by calling sd_revalidate_disk, and revalidate_disk_size where needed. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi

[dm-devel] [PATCH 2/9] block: don't clear bd_invalidated in check_disk_size_change

2020-09-01 Thread Christoph Hellwig
with the bd_invalidated event. revalidate_disk() on the other hand is mostly used to propagate a size update from the gendisk to the block device, which is entirely unrelated. Signed-off-by: Christoph Hellwig --- fs/block_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs

[dm-devel] [PATCH 4/9] block: add a new revalidate_disk_size helper

2020-09-01 Thread Christoph Hellwig
helper that just performs the update of the block device size from the gendisk one, and switch all drivers that do not implement ->revalidate_disk to use the new helper instead of revalidate_disk() Signed-off-by: Christoph Hellwig --- drivers/block/rbd.c | 2 +- drivers/block/rnbd/r

[dm-devel] [PATCH 3/9] block: rename bd_invalidated

2020-09-01 Thread Christoph Hellwig
Replace bd_invalidate with a new BDEV_NEED_PART_SCAN flag in a bd_flags variable to better describe the condition. Signed-off-by: Christoph Hellwig --- block/genhd.c | 2 +- drivers/block/nbd.c | 8 fs/block_dev.c| 10 +- include/linux

[dm-devel] [PATCH 6/9] nvme: opencode revalidate_disk in nvme_validate_ns

2020-09-01 Thread Christoph Hellwig
called from the open code when first opening the device. Which is of course totally pointless as we have a valid size since the initial scan, and will get an updated view through the asynchronous notifiation everytime the size changes. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.

[dm-devel] [PATCH 1/9] Documentation/filesystems/locking.rst: remove an incorrect sentence

2020-09-01 Thread Christoph Hellwig
unlock_native_capacity is never called from check_disk_change(), and while revalidate_disk can be called from it, it can also be called from two other places at the moment. Signed-off-by: Christoph Hellwig --- Documentation/filesystems/locking.rst | 3 --- 1 file changed, 3 deletions(-) diff

[dm-devel] [PATCH 09/12] mm: use SWP_SYNCHRONOUS_IO more intelligently

2020-09-10 Thread Christoph Hellwig
There is no point in trying to call bdev_read_page if SWP_SYNCHRONOUS_IO is not set, as the device won't support it. Signed-off-by: Christoph Hellwig --- mm/page_io.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index

[dm-devel] [PATCH 12/12] bdi: replace BDI_CAP_NO_{WRITEBACK, ACCT_DIRTY} with a single flag

2020-09-10 Thread Christoph Hellwig
Replace the two negative flags that are always used together with a single positive flag that indicates the writeback capability instead of two related non-capabilities. Also remove the pointless wrappers to just check the flag. Signed-off-by: Christoph Hellwig --- fs/9p/vfs_file.c

[dm-devel] [PATCH 08/12] bdi: remove BDI_CAP_SYNCHRONOUS_IO

2020-09-10 Thread Christoph Hellwig
ort ->rw_page and those who don't. Signed-off-by: Christoph Hellwig --- drivers/block/brd.c | 1 - drivers/block/zram/zram_drv.c | 19 +-- drivers/nvdimm/btt.c | 2 -- drivers/nvdimm/pmem.c | 1 - include/linux/backing-dev.h | 9 - mm/swap

[dm-devel] [PATCH 10/12] bdi: replace BDI_CAP_STABLE_WRITES with a queue and a sb flag

2020-09-10 Thread Christoph Hellwig
for easier testing. Signed-off-by: Christoph Hellwig --- block/blk-integrity.c | 4 ++-- block/blk-mq-debugfs.c| 1 + block/blk-sysfs.c | 3 +++ drivers/block/rbd.c | 2 +- drivers/block/zram/zram_drv.c | 2 +- drivers/md/dm-table.c | 6

[dm-devel] [PATCH 07/12] bdi: remove BDI_CAP_CGROUP_WRITEBACK

2020-09-10 Thread Christoph Hellwig
Just checking SB_I_CGROUPWB for cgroup writeback support is enough. Either the file system allocates its own bdi (e.g. btrfs), in which case it is known to support cgroup writeback, or the bdi comes from the block layer, which always supports cgroup writeback. Signed-off-by: Christoph Hellwig

[dm-devel] [PATCH 04/12] bdi: initialize ->ra_pages and ->io_pages in bdi_init

2020-09-10 Thread Christoph Hellwig
Set up a readahead size by default, as very few users have a good reason to change it. Signed-off-by: Christoph Hellwig Acked-by: David Sterba [btrfs] Acked-by: Richard Weinberger [ubifs, mtd] --- block/blk-core.c | 2 -- drivers/mtd/mtdcore.c | 2 ++ fs/9p/vfs_super.c | 6 -- fs

[dm-devel] [PATCH 06/12] block: lift setting the readahead size into the block layer

2020-09-10 Thread Christoph Hellwig
off-by: Christoph Hellwig --- block/blk-settings.c | 5 ++--- block/blk-sysfs.c| 10 +- block/genhd.c| 5 +++-- drivers/block/aoe/aoeblk.c | 2 -- drivers/block/drbd/drbd_nl.c | 12 +--- drivers/md/bcache/super.c| 4 drivers/md

[dm-devel] bdi cleanups v4

2020-09-10 Thread Christoph Hellwig
Hi Jens, this series contains a bunch of different BDI cleanups. The biggest item is to isolate block drivers from the BDI in preparation of changing the lifetime of the block device BDI in a follow up series. Changes since v3: - rebased on the lasted block tree, which has some of the prep

[dm-devel] [PATCH 11/12] bdi: invert BDI_CAP_NO_ACCT_WB

2020-09-10 Thread Christoph Hellwig
Replace BDI_CAP_NO_ACCT_WB with a positive BDI_CAP_WRITEBACK_ACCT to make the checks more obvious. Also remove the pointless bdi_cap_account_writeback wrapper that just obsfucates the check. Signed-off-by: Christoph Hellwig --- fs/fuse/inode.c | 3 ++- include/linux/backing-dev.h

[dm-devel] [PATCH 02/12] drbd: remove dead code in device_to_statistics

2020-09-10 Thread Christoph Hellwig
Ever since the switch to blk-mq, a lower device not used for VM writeback will not be marked congested, so the check will never trigger. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_nl.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/block/drbd/drbd_nl.c b

[dm-devel] [PATCH 03/12] drbd: remove RB_CONGESTED_REMOTE

2020-09-10 Thread Christoph Hellwig
This case isn't ever used. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/block/drbd/drbd_req.c | 4 include/linux/drbd.h | 1 - 2 files changed, 5 deletions(-) diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index

[dm-devel] [PATCH 05/12] md: update the optimal I/O size on reshape

2020-09-10 Thread Christoph Hellwig
The raid5 and raid10 drivers currently update the read-ahead size, but not the optimal I/O size on reshape. To prepare for deriving the read-ahead size from the optimal I/O size make sure it is updated as well. Signed-off-by: Christoph Hellwig --- drivers/md/raid10.c | 22

[dm-devel] [PATCH 01/12] fs: remove the unused SB_I_MULTIROOT flag

2020-09-10 Thread Christoph Hellwig
The last user of SB_I_MULTIROOT is disappeared with commit f2aedb713c28 ("NFS: Add fs_context support.") Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- fs/namei.c | 4 ++-- include/linux/fs.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff

Re: [dm-devel] [ Regressions ] linux next 20201008: blk_update_request: I/O error, dev sda, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 0 prio class 0

2020-10-08 Thread Christoph Hellwig
On Thu, Oct 08, 2020 at 02:17:41PM -0600, Jens Axboe wrote: > Just for everyones edification, that would be these 9 patches from the > SCSI tree: I sent the fixes out a bit ago and Cced the reporters.. -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH v2 2/4] block: add private field to struct keyslot_manager

2020-10-16 Thread Christoph Hellwig
On Thu, Oct 15, 2020 at 09:46:30PM +, Satya Tangirala wrote: > Add a (void *) pointer to struct keyslot_manager that the owner of the > struct can use for any purpose it wants. > > Right now, the struct keyslot_manager is expected to be embedded directly > into other structs (and the owner of

[dm-devel] [PATCH 1/2] block: replace bd_set_size with bd_set_nr_sectors

2020-08-21 Thread Christoph Hellwig
Replace bd_set_size with a version that takes the number of sectors instead, as that fits most of the current and future callers much better. Signed-off-by: Christoph Hellwig --- drivers/block/loop.c | 4 ++-- drivers/block/nbd.c | 7 --- drivers/block/pktcdvd.c | 2 +- drivers

[dm-devel] fix block device size update serialization

2020-08-21 Thread Christoph Hellwig
Hi Jens, this series fixes how we update i_size for the block device inodes (and thus the block device). Different helpers use two different locks (bd_mutex and i_rwsem) to protect the update, and it appears device mapper uses yet another internal lock. A lot of the drivers do the update

[dm-devel] [PATCH 2/2] block: fix locking for struct block_device size updates

2020-08-21 Thread Christoph Hellwig
-by: Xianting Tian Signed-off-by: Christoph Hellwig --- block/partitions/core.c | 4 ++-- drivers/block/aoe/aoecmd.c | 4 +--- drivers/md/dm.c | 15 ++- drivers/s390/block/dasd_ioctl.c | 9 ++--- fs/block_dev.c | 18

Re: [dm-devel] fix block device size update serialization v2

2020-08-27 Thread Christoph Hellwig
Jens, can you consider this for 5.9? It reliably fixes the reported hangs with nvme hotremoval that we've had for a few releases. On Sun, Aug 23, 2020 at 11:10:40AM +0200, Christoph Hellwig wrote: > Hi Jens, > > this series fixes how we update i_size for the block device inodes (a

Re: [dm-devel] [PATCH 2/2] block: fix locking for struct block_device size updates

2020-08-23 Thread Christoph Hellwig
On Fri, Aug 21, 2020 at 06:02:32PM +0800, 田 wrote: > thanks Hellwig for your kindly reply and your fix and add report by me :) I found an issue with the patch, and will send a new version in a bit. If this works for your reproducer, can you add a Tested-by: tag? -- dm-devel mailing list

[dm-devel] [PATCH 2/3] block: fix locking for struct block_device size updates

2020-08-23 Thread Christoph Hellwig
currently deadlock on bd_mutex. Reported-by: Xianting Tian Signed-off-by: Christoph Hellwig --- block/partitions/core.c | 4 ++-- drivers/block/aoe/aoecmd.c | 4 +--- drivers/md/dm.c | 15 ++- drivers/s390/block/dasd_ioctl.c | 9 ++--- fs/block_dev.c

[dm-devel] fix block device size update serialization v2

2020-08-23 Thread Christoph Hellwig
Hi Jens, this series fixes how we update i_size for the block device inodes (and thus the block device). Different helpers use two different locks (bd_mutex and i_rwsem) to protect the update, and it appears device mapper uses yet another internal lock. A lot of the drivers do the update

[dm-devel] [PATCH 1/3] block: replace bd_set_size with bd_set_nr_sectors

2020-08-23 Thread Christoph Hellwig
Replace bd_set_size with a version that takes the number of sectors instead, as that fits most of the current and future callers much better. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/loop.c | 4 ++-- drivers/block/nbd.c | 7 --- drivers

[dm-devel] [PATCH 3/3] nvme: don't call revalidate_disk from nvme_set_queue_dying

2020-08-23 Thread Christoph Hellwig
, and rename and move the nvme_mpath_update_disk_size helper so that we can use it in nvme_set_queue_dying to propagate the size to the bdev without detours. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 33 +++-- drivers/nvme/host/nvme.h | 13 - 2

Re: [dm-devel] [PATCH 05/13] bdi: initialize ->ra_pages and ->io_pages in bdi_init

2020-09-23 Thread Christoph Hellwig
On Tue, Sep 22, 2020 at 10:49:54AM +0200, Jan Kara wrote: > On Mon 21-09-20 10:07:26, Christoph Hellwig wrote: > > Set up a readahead size by default, as very few users have a good > > reason to change it. > > > > Signed-off-by: Christoph Hellwig > > Acked-by

[dm-devel] [PATCH 08/13] bdi: remove BDI_CAP_CGROUP_WRITEBACK

2020-09-24 Thread Christoph Hellwig
Just checking SB_I_CGROUPWB for cgroup writeback support is enough. Either the file system allocates its own bdi (e.g. btrfs), in which case it is known to support cgroup writeback, or the bdi comes from the block layer, which always supports cgroup writeback. Signed-off-by: Christoph Hellwig

[dm-devel] [PATCH 11/13] bdi: replace BDI_CAP_STABLE_WRITES with a queue and a sb flag

2020-09-24 Thread Christoph Hellwig
testing. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Johannes Thumshirn --- block/blk-integrity.c | 4 ++-- block/blk-mq-debugfs.c| 1 + block/blk-sysfs.c | 3 +++ drivers/block/rbd.c | 2 +- drivers/block/zram/zram_drv.c | 2

[dm-devel] bdi cleanups v7

2020-09-24 Thread Christoph Hellwig
Hi Jens, this series contains a bunch of different BDI cleanups. The biggest item is to isolate block drivers from the BDI in preparation of changing the lifetime of the block device BDI in a follow up series. Changes since v6: - add a new blk_queue_update_readahead helper and use it in

[dm-devel] [PATCH 09/13] bdi: remove BDI_CAP_SYNCHRONOUS_IO

2020-09-24 Thread Christoph Hellwig
ort ->rw_page and those who don't. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Johannes Thumshirn --- drivers/block/brd.c | 1 - drivers/block/zram/zram_drv.c | 19 +-- drivers/nvdimm/btt.c | 2 -- drivers/nvdimm/pmem.c

[dm-devel] [PATCH 04/13] aoe: set an optimal I/O size

2020-09-24 Thread Christoph Hellwig
aoe forces a larger readahead size, but any reason to do larger I/O is not limited to readahead. Also set the optimal I/O size, and remove the local constants in favor of just using SZ_2G. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- drivers/block/aoe/aoeblk.c | 4 ++-- 1 file

[dm-devel] [PATCH 01/13] fs: remove the unused SB_I_MULTIROOT flag

2020-09-24 Thread Christoph Hellwig
The last user of SB_I_MULTIROOT is disappeared with commit f2aedb713c28 ("NFS: Add fs_context support.") Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Johannes Thumshirn --- fs/namei.c | 4 ++-- include/linux/fs.h | 1 - 2 files changed, 2 insert

[dm-devel] [PATCH 06/13] md: update the optimal I/O size on reshape

2020-09-24 Thread Christoph Hellwig
The raid5 and raid10 drivers currently update the read-ahead size, but not the optimal I/O size on reshape. To prepare for deriving the read-ahead size from the optimal I/O size make sure it is updated as well. Signed-off-by: Christoph Hellwig Acked-by: Song Liu Reviewed-by: Johannes Thumshirn

[dm-devel] [PATCH 07/13] block: lift setting the readahead size into the block layer

2020-09-24 Thread Christoph Hellwig
ure the limits work well for stacking drivers a new helper is added to update the readahead limits from the block limits, which is also called from disk_stack_limits. Signed-off-by: Christoph Hellwig Acked-by: Coly Li Reviewed-by: Johannes Thumshirn --- block/blk-settings.c |

[dm-devel] [PATCH 02/13] drbd: remove dead code in device_to_statistics

2020-09-24 Thread Christoph Hellwig
Ever since the switch to blk-mq, a lower device not used for VM writeback will not be marked congested, so the check will never trigger. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Johannes Thumshirn --- drivers/block/drbd/drbd_nl.c | 6 -- 1 file changed, 6

[dm-devel] [PATCH 05/13] bdi: initialize ->ra_pages and ->io_pages in bdi_init

2020-09-24 Thread Christoph Hellwig
Set up a readahead size by default, as very few users have a good reason to change it. This means code, ecryptfs, and orangefs now set up the values while they were previously missing it, while ubifs, mtd and vboxsf manually set it to 0 to avoid readahead. Signed-off-by: Christoph Hellwig

[dm-devel] [PATCH 13/13] bdi: replace BDI_CAP_NO_{WRITEBACK, ACCT_DIRTY} with a single flag

2020-09-24 Thread Christoph Hellwig
Replace the two negative flags that are always used together with a single positive flag that indicates the writeback capability instead of two related non-capabilities. Also remove the pointless wrappers to just check the flag. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed

[dm-devel] [PATCH 10/13] mm: use SWP_SYNCHRONOUS_IO more intelligently

2020-09-24 Thread Christoph Hellwig
There is no point in trying to call bdev_read_page if SWP_SYNCHRONOUS_IO is not set, as the device won't support it. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Johannes Thumshirn --- mm/page_io.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions

[dm-devel] [PATCH 03/13] bcache: inherit the optimal I/O size

2020-09-24 Thread Christoph Hellwig
Inherit the optimal I/O size setting just like the readahead window, as any reason to do larger I/O does not apply to just readahead. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Coly Li --- drivers/md/bcache/super.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

Re: [dm-devel] [PATCH 03/13] bcache: inherit the optimal I/O size

2020-09-21 Thread Christoph Hellwig
On Mon, Sep 21, 2020 at 11:09:48PM +0800, Coly Li wrote: > I feel this is something should be fixed. Indeed I overlooked it until > you point out the issue now. > > The optimal request size and read ahead pages hint are necessary, but > current initialization is simple. A better way might be

Re: [dm-devel] [PATCH 03/12] drbd: remove RB_CONGESTED_REMOTE

2020-09-19 Thread Christoph Hellwig
On Thu, Sep 17, 2020 at 11:55:07AM +0200, Jan Kara wrote: > On Thu 10-09-20 16:48:23, Christoph Hellwig wrote: > > This case isn't ever used. > > > > Signed-off-by: Christoph Hellwig > > Reviewed-by: Johannes Thumshirn > > Are you sure it's never used

Re: [dm-devel] [PATCH 04/12] bdi: initialize ->ra_pages and ->io_pages in bdi_init

2020-09-19 Thread Christoph Hellwig
On Thu, Sep 17, 2020 at 12:04:59PM +0200, Jan Kara wrote: > On Thu 10-09-20 16:48:24, Christoph Hellwig wrote: > > Set up a readahead size by default, as very few users have a good > > reason to change it. > > > > Signed-off-by: Christoph Hellwig > > Acked-by

Re: [dm-devel] [PATCH 06/12] block: lift setting the readahead size into the block layer

2020-09-19 Thread Christoph Hellwig
On Thu, Sep 17, 2020 at 12:35:40PM +0200, Jan Kara wrote: > > diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c > > index 81722cdcf0cb21..95eb35324e1a61 100644 > > --- a/block/blk-sysfs.c > > +++ b/block/blk-sysfs.c > > @@ -245,7 +245,6 @@ queue_max_sectors_store(struct request_queue *q, const >

Re: [dm-devel] [PATCH 10/12] bdi: replace BDI_CAP_STABLE_WRITES with a queue and a sb flag

2020-09-19 Thread Christoph Hellwig
On Thu, Sep 17, 2020 at 11:25:24AM +0200, Jan Kara wrote: > On Thu 10-09-20 16:48:30, Christoph Hellwig wrote: > > The BDI_CAP_STABLE_WRITES is one of the few bits of information in the > > backing_dev_info shared between the block drivers and the writeback code. > &g

Re: [dm-devel] [PATCH 1/2] block: add QUEUE_FLAG_NOWAIT

2020-09-24 Thread Christoph Hellwig
Also > update submit_bio_checks() to verify it is set for REQ_NOWAIT bios. > > Reported-by: Konstantin Khlebnikov > Suggested-by: Christoph Hellwig > Signed-off-by: Mike Snitzer Looks good: Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://www.

[dm-devel] [PATCH 05/16] bcache: use bio_{start,end}_io_acct

2020-05-25 Thread Christoph Hellwig
Switch bcache to use the nicer bio accounting helpers, and call the routines where we also sample the start time to give coherent accounting results. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/request.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff

[dm-devel] [PATCH 07/16] nvdimm: use bio_{start,end}_io_acct

2020-05-25 Thread Christoph Hellwig
Switch dm to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig --- drivers/nvdimm/blk.c | 6 -- drivers/nvdimm/btt.c | 6 -- drivers/nvdimm/nd.h | 19 --- drivers/nvdimm/pmem.c | 6 -- 4 files changed, 12 insertions(+), 25 deletions

[dm-devel] [PATCH 15/16] block: use __this_cpu_add() instead of access by smp_processor_id()

2020-05-25 Thread Christoph Hellwig
From: Konstantin Khlebnikov Most architectures have fast path to access percpu for current cpu. The required preempt_disable() is provided by part_stat_lock(). Signed-off-by: Konstantin Khlebnikov [hch: rebased] Signed-off-by: Christoph Hellwig --- include/linux/part_stat.h | 2 +- 1 file

[dm-devel] [PATCH 13/16] block: add a blk_account_io_merge_bio helper

2020-05-25 Thread Christoph Hellwig
t_io_start(), as there is no reason for that. Signed-off-by: Konstantin Khlebnikov [hch: rebased] Signed-off-by: Christoph Hellwig --- block/blk-core.c | 25 - block/blk-exec.c | 2 +- block/blk-mq.c | 2 +- block/blk.h | 2 +- 4 files changed, 19 insertions(+), 12 deletions(-)

[dm-devel] [PATCH 11/16] block: always use a percpu variable for disk stats

2020-05-25 Thread Christoph Hellwig
percpu variables have a perfectly fine working stub implementation for UP kernels, so use that. Signed-off-by: Christoph Hellwig --- block/blk.h | 2 +- block/genhd.c | 12 +++-- block/partitions/core.c | 5 ++-- include/linux/genhd.h | 13

[dm-devel] [PATCH 02/16] drbd: use bio_{start,end}_io_acct

2020-05-25 Thread Christoph Hellwig
Switch drbd to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_req.c | 27 --- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index

[dm-devel] [PATCH 04/16] lightnvm/pblk: use bio_{start, end}_io_acct

2020-05-25 Thread Christoph Hellwig
Switch rsxx to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig --- drivers/lightnvm/pblk-cache.c | 8 +++- drivers/lightnvm/pblk-read.c | 11 --- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/lightnvm/pblk-cache.c b/drivers/lightnvm

[dm-devel] [PATCH 09/16] block: remove generic_{start, end}_io_acct

2020-05-25 Thread Christoph Hellwig
Remove these now unused functions. Signed-off-by: Christoph Hellwig --- block/bio.c | 39 --- include/linux/bio.h | 6 -- 2 files changed, 45 deletions(-) diff --git a/block/bio.c b/block/bio.c index 9c101a0572ca2..3e89c7b37855a 100644

[dm-devel] [PATCH 06/16] dm: use bio_{start,end}_io_acct

2020-05-25 Thread Christoph Hellwig
Switch dm to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f215b86664484..3f39fa1ac756e 100644 --- a/drivers/md/dm.c +++ b/drivers/md

[dm-devel] [PATCH 10/16] block: move update_io_ticks to blk-core.c

2020-05-25 Thread Christoph Hellwig
All callers are in blk-core.c, so move update_io_ticks over. Signed-off-by: Christoph Hellwig --- block/bio.c | 16 block/blk-core.c | 15 +++ block/blk.h | 1 - 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/block/bio.c b/block/bio.c

[dm-devel] [PATCH 08/16] zram: nvdimm: use bio_{start, end}_io_acct and disk_{start, end}_io_acct

2020-05-25 Thread Christoph Hellwig
Switch zram to use the nicer bio accounting helpers, and as part of that ensure each bio is counted as a single I/O request. Signed-off-by: Christoph Hellwig --- drivers/block/zram/zram_drv.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers

[dm-devel] [PATCH 01/16] block: add disk/bio-based accounting helpers

2020-05-25 Thread Christoph Hellwig
-by: Christoph Hellwig --- block/blk-core.c | 34 ++ include/linux/blkdev.h | 26 ++ 2 files changed, 60 insertions(+) diff --git a/block/blk-core.c b/block/blk-core.c index 77e57c2e8d602..8973104f88d90 100644 --- a/block/blk-core.c +++ b

[dm-devel] [PATCH 12/16] block: account merge of two requests

2020-05-25 Thread Christoph Hellwig
From: Konstantin Khlebnikov Also rename blk_account_io_merge() into blk_account_io_merge_request() to distinguish it from merging request and bio. Signed-off-by: Konstantin Khlebnikov [hch: rebased] Signed-off-by: Christoph Hellwig --- block/blk-merge.c | 12 +--- 1 file changed, 5

[dm-devel] [PATCH 14/16] block: remove rcu_read_lock() from part_stat_lock()

2020-05-25 Thread Christoph Hellwig
] Signed-off-by: Christoph Hellwig --- block/genhd.c | 11 --- include/linux/part_stat.h | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index 3e7df0a3e6bb0..1a76593276644 100644 --- a/block/genhd.c +++ b/block/genhd.c

[dm-devel] block I/O accounting improvements

2020-05-25 Thread Christoph Hellwig
Hi Jens, they series contains various improvement for block I/O accounting. The first bunch of patches switch the bio based drivers to better accounting helpers compared to the current mess. The end contains a fix and various performanc improvements. Most of this comes from a series Konstantin

[dm-devel] [PATCH 01/16] block: add disk/bio-based accounting helpers

2020-05-26 Thread Christoph Hellwig
-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov --- block/blk-core.c | 34 ++ include/linux/blkdev.h | 28 2 files changed, 62 insertions(+) diff --git a/block/blk-core.c b/block/blk-core.c index 77e57c2e8d602..8973104f88d90

[dm-devel] [PATCH 13/16] block: add a blk_account_io_merge_bio helper

2020-05-26 Thread Christoph Hellwig
t_io_start(), as there is no reason for that. Signed-off-by: Konstantin Khlebnikov [hch: rebased] Signed-off-by: Christoph Hellwig --- block/blk-core.c | 25 - block/blk-exec.c | 2 +- block/blk-mq.c | 2 +- block/blk.h | 2 +- 4 files changed, 19 insertions(+), 12 deletions(-)

[dm-devel] [PATCH 03/16] rsxx: use bio_{start,end}_io_acct

2020-05-26 Thread Christoph Hellwig
Switch rsxx to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov --- drivers/block/rsxx/dev.c | 19 ++- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/block/rsxx/dev.c b/drivers/block/rsxx/dev.c

<    2   3   4   5   6   7   8   9   10   11   >