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

2020-05-26 Thread Christoph Hellwig
On Mon, May 25, 2020 at 03:28:07PM +0300, Konstantin Khlebnikov wrote: > I think it would be better to leave this jiffies legacy nonsense in > callers and pass here request duration in nanoseconds. jiffies is what the existing interfaces uses. But now that they come from the start helper fixing

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

2020-05-26 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 08/16] zram: nvdimm: use bio_{start, end}_io_acct and disk_{start, end}_io_acct

2020-05-26 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 Reviewed-by: Konstantin Khlebnikov --- drivers/block/zram/zram_drv.c | 24 ++-- 1 file changed, 10 insertions(+), 14

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

2020-05-26 Thread Christoph Hellwig
Switch drbd to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov --- 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

[dm-devel] [PATCH 04/16] lightnvm/pblk: 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/lightnvm/pblk-cache.c | 8 +++- drivers/lightnvm/pblk-read.c | 11 --- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers

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

2020-05-26 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] block I/O accounting improvements v2

2020-05-26 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 09/16] block: remove generic_{start, end}_io_acct

2020-05-26 Thread Christoph Hellwig
Remove these now unused functions. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov --- 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

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

2020-05-26 Thread Christoph Hellwig
Switch dm to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov --- drivers/nvdimm/blk.c | 6 -- drivers/nvdimm/btt.c | 6 -- drivers/nvdimm/nd.h | 19 --- drivers/nvdimm/pmem.c | 6 -- 4 files changed

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

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

[dm-devel] [PATCH 16/16] block: reduce part_stat_lock() scope

2020-05-26 Thread Christoph Hellwig
We only need the stats lock (aka preempt_disable()) for updating the states, not for looking up or dropping the hd_struct reference. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov --- block/blk-core.c | 5 +++-- block/blk-merge.c | 3 ++- 2 files changed, 5 insertions

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

2020-05-26 Thread Christoph Hellwig
Switch dm to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov --- 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

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

2020-05-26 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 Reviewed-by: Konstantin Khlebnikov Acked-by: Coly Li --- drivers/md/bcache/request.c | 18

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

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

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

2020-05-26 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] [PATCH 04/13] aoe: set an optimal I/O size

2020-09-21 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 --- drivers/block/aoe/aoeblk.c | 4 ++-- 1 file changed, 2 insertions

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

2020-09-21 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 03/13] bcache: inherit the optimal I/O size

2020-09-21 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 --- drivers/md/bcache/super.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/md/bcache/super.c b/drivers/md

[dm-devel] bdi cleanups v6

2020-09-21 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 v5: - improve a commit message - improve the stable_writes

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

2020-09-21 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 11/13] bdi: replace BDI_CAP_STABLE_WRITES with a queue and a sb flag

2020-09-21 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] [PATCH 09/13] bdi: remove BDI_CAP_SYNCHRONOUS_IO

2020-09-21 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 08/13] bdi: remove BDI_CAP_CGROUP_WRITEBACK

2020-09-21 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 10/13] mm: use SWP_SYNCHRONOUS_IO more intelligently

2020-09-21 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 02/13] drbd: remove dead code in device_to_statistics

2020-09-21 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 07/13] block: lift setting the readahead size into the block layer

2020-09-21 Thread Christoph Hellwig
off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- block/blk-settings.c | 5 ++--- block/blk-sysfs.c| 9 + drivers/block/aoe/aoeblk.c | 1 - drivers/block/drbd/drbd_nl.c | 12 +--- drivers/md/bcache/super.c| 3 --- drivers/md/raid

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

2020-09-21 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 06/13] md: update the optimal I/O size on reshape

2020-09-21 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 12/13] bdi: invert BDI_CAP_NO_ACCT_WB

2020-09-21 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: Jan Kara Reviewed-by: Johannes Thumshirn --- fs/fuse

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 05:54:59PM +0800, Coly Li wrote: > I am not sure whether virtual bcache device's optimal request size can > be simply set like this. > > Most of time inherit backing device's optimal request size is fine, but > there are two exceptions, > - Read request hits on cache

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

2020-07-22 Thread Christoph Hellwig
Ever since the switch to blk-mq, a lower device not use by 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 13/14] bdi: invert BDI_CAP_NO_ACCT_WB

2020-07-22 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 07/14] block: make QUEUE_SYSFS_BIT_FNS a little more useful

2020-07-22 Thread Christoph Hellwig
Generate the queue_sysfs_entry given that we have all the required information for it, and rename the generated show and store methods to match the other ones in the file. Signed-off-by: Christoph Hellwig --- block/blk-sysfs.c | 31 +-- 1 file changed, 9 insertions

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

2020-07-22 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 03/14] drbd: remove RB_CONGESTED_REMOTE

2020-07-22 Thread Christoph Hellwig
This case isn't ever used. Signed-off-by: Christoph Hellwig --- 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 674be09b2da94a..4d944f2eb56efa 100644

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

2020-07-22 Thread Christoph Hellwig
On Wed, Jul 22, 2020 at 07:03:21AM +, Johannes Thumshirn wrote: > On 22/07/2020 08:28, Christoph Hellwig wrote: > > Ever since the switch to blk-mq, a lower device not use by VM >in-use/used? ~^ Yeah, this should be used. > Also

[dm-devel] [PATCH 04/14] bdi: initialize ->ra_pages in bdi_init

2020-07-22 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 --- block/blk-core.c | 1 - drivers/mtd/mtdcore.c | 1 + fs/9p/vfs_super.c | 4 ++-- fs/afs/super.c| 1 - fs/btrfs/disk-io.c| 1 - fs/fuse/inode.c

[dm-devel] [PATCH 11/14] mm: use SWP_SYNCHRONOUS_IO more intelligently

2020-07-22 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 09/14] bdi: remove BDI_CAP_CGROUP_WRITEBACK

2020-07-22 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 know 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 05/14] md: update the optimal I/O size on reshape

2020-07-22 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] bdi cleanups v2

2020-07-22 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 v1: - rebased to the for-5.9/block-merge branch - explicitly set the

[dm-devel] [PATCH 10/14] bdi: remove BDI_CAP_SYNCHRONOUS_IO

2020-07-22 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 08/14] block: add helper macros for queue sysfs entries

2020-07-22 Thread Christoph Hellwig
Add two helpers macros to avoid boilerplate code for the queue sysfs entries. Signed-off-by: Christoph Hellwig --- block/blk-sysfs.c | 248 +++--- 1 file changed, 58 insertions(+), 190 deletions(-) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index

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

2020-07-22 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- fs/namei.c | 4 ++-- include/linux/fs.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 72d4219c93acb7..e9ff0d54a110a7 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -568,8 +568,8 @@ static bool

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

2020-07-22 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 | 2 ++ drivers/block/rbd.c | 2 +- drivers/block/zram/zram_drv.c | 2 +- drivers/md/dm-table.c | 6

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

2020-07-22 Thread Christoph Hellwig
On Wed, Jul 22, 2020 at 07:13:54AM +, Johannes Thumshirn wrote: > On 22/07/2020 08:27, Christoph Hellwig wrote: > > + q->backing_dev_info->ra_pages = > > + max(queue_io_opt(q) * 2 / PAGE_SIZE, VM_READAHEAD_PAGES); > > Dumb question, wouldn't a '>&

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

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

Re: [dm-devel] [RESEND PATCH] nvme: explicitly use normal NVMe error handling when appropriate

2020-08-13 Thread Christoph Hellwig
On Thu, Aug 13, 2020 at 10:48:11AM -0400, Mike Snitzer wrote: > Commit 764e9332098c0 ("nvme-multipath: do not reset on unknown > status"), among other things, fixed NVME_SC_CMD_INTERRUPTED error > handling by changing multipathing's nvme_failover_req() to short-circuit > path failover and then

Re: [dm-devel] [PATCH 08/11] block: fix the comments in the trace event block.h

2020-06-29 Thread Christoph Hellwig
On Mon, Jun 29, 2020 at 04:43:11PM -0700, Chaitanya Kulkarni wrote: > This is purely cleanup patch which fixes the comment in trace event > header for block_rq_issue() and block_rq_merge() events. > > Signed-off-by: Chaitanya Kulkarni Looks good, Reviewed-by: Christoph Hellwig

Re: [dm-devel] [PATCH 02/11] block: rename block_bio_merge class to block_bio

2020-06-29 Thread Christoph Hellwig
On Mon, Jun 29, 2020 at 04:43:05PM -0700, Chaitanya Kulkarni wrote: > There are identical TRACE_EVENTS presents which can now take an > advantage of the block_bio_merge trace event class. > > This is a prep patch which renames block_bio_merge to block_bio so > that the next patches in this series

Re: [dm-devel] [PATCH 07/11] block: get rid of blk_trace_request_get_cgid()

2020-06-29 Thread Christoph Hellwig
On Mon, Jun 29, 2020 at 04:43:10PM -0700, Chaitanya Kulkarni wrote: > Now that we have done cleanup we can safely get rid of the > blk_trace_request_get_cgid() and replace it with > blk_trace_bio_get_cgid(). To me the helper actually looks useful compared to open coding the check in a bunch of

Re: [dm-devel] [PATCH 09/11] block: remove unsed param in blk_fill_rwbs()

2020-06-29 Thread Christoph Hellwig
On Mon, Jun 29, 2020 at 04:43:12PM -0700, Chaitanya Kulkarni wrote: > The last parameter for the function blk_fill_rwbs() was added in > 5782138e47 ("tracing/events: convert block trace points to > TRACE_EVENT()") in order to signal read request and use of that parameter > was replaced with using

Re: [dm-devel] [PATCH 10/11] block: use block_bio class for getrq and sleeprq

2020-06-29 Thread Christoph Hellwig
On Mon, Jun 29, 2020 at 04:43:13PM -0700, Chaitanya Kulkarni wrote: > The only difference in block_get_rq and block_bio was the last param > passed __entry->nr_sector & bio->bi_iter.bi_size respectively. Since > that is not the case anymore replace block_get_rq class with block_bio > for

Re: [dm-devel] [PATCH 05/11] block: get rid of the trace rq insert wrapper

2020-06-29 Thread Christoph Hellwig
On Mon, Jun 29, 2020 at 04:43:08PM -0700, Chaitanya Kulkarni wrote: > Get rid of the wrapper for trace_block_rq_insert() and call the function > directly. I'd mention blk_mq_sched_request_inserted instead of the tracepoint in the subject and commit message. Otherwise this looks fine. --

Re: [dm-devel] [PATCH 01/11] block: blktrace framework cleanup

2020-06-29 Thread Christoph Hellwig
On Mon, Jun 29, 2020 at 04:43:04PM -0700, Chaitanya Kulkarni wrote: > This patch removes the extra variables from the trace events and > overall kernel blktrace framework. The removed members can easily be > extracted from the remaining argument which reduces the code > significantly and allows us

Re: [dm-devel] [PATCH 18/20] block: refator submit_bio_noacct

2020-07-02 Thread Christoph Hellwig
On Thu, Jul 02, 2020 at 10:10:10AM -0400, Qian Cai wrote: > On Mon, Jun 29, 2020 at 09:39:45PM +0200, Christoph Hellwig wrote: > > Split out a __submit_bio_noacct helper for the actual de-recursion > > algorithm, and simplify the loop by using a continue when we can't > > ente

Re: [dm-devel] rename ->make_request_fn and move it to the block_device_operations

2020-06-30 Thread Christoph Hellwig
On Tue, Jun 30, 2020 at 09:43:31AM -0600, Jens Axboe wrote: > On 6/30/20 7:57 AM, Jens Axboe wrote: > > On 6/29/20 1:39 PM, Christoph Hellwig wrote: > >> Hi Jens, > >> > >> this series moves the make_request_fn method into block_device_operations > >>

Re: [dm-devel] remove dead bdi congestion leftovers

2020-07-09 Thread Christoph Hellwig
On Thu, Jul 09, 2020 at 07:58:58AM -0600, Jens Axboe wrote: > On 7/8/20 11:32 PM, Christoph Hellwig wrote: > > On Wed, Jul 08, 2020 at 05:14:29PM -0600, Jens Axboe wrote: > >> On 7/1/20 3:06 AM, Christoph Hellwig wrote: > >>> Hi Jens, > >>> > >

Re: [dm-devel] [PATCH 07/11] block: get rid of blk_trace_request_get_cgid()

2020-07-01 Thread Christoph Hellwig
On Wed, Jul 01, 2020 at 04:38:06AM +, Chaitanya Kulkarni wrote: > On 6/29/20 10:12 PM, Christoph Hellwig wrote: > > On Mon, Jun 29, 2020 at 04:43:10PM -0700, Chaitanya Kulkarni wrote: > >> Now that we have done cleanup we can safely get rid of the > >> blk_trace_req

Re: [dm-devel] [PATCH 10/11] block: use block_bio class for getrq and sleeprq

2020-07-01 Thread Christoph Hellwig
On Wed, Jul 01, 2020 at 04:45:03AM +, Chaitanya Kulkarni wrote: > On 6/29/20 10:13 PM, Christoph Hellwig wrote: > > On Mon, Jun 29, 2020 at 04:43:13PM -0700, Chaitanya Kulkarni wrote: > >> The only difference in block_get_rq and block_bio was the last param > >>

Re: [dm-devel] remove dead bdi congestion leftovers

2020-07-08 Thread Christoph Hellwig
On Wed, Jul 08, 2020 at 05:14:29PM -0600, Jens Axboe wrote: > On 7/1/20 3:06 AM, Christoph Hellwig wrote: > > Hi Jens, > > > > we have a lot of bdi congestion related code that is left around without > > any use. This series removes it in preparation of sorting out

Re: [dm-devel] [PATCH RFC] block: blktrace framework cleanup

2020-06-24 Thread Christoph Hellwig
On Tue, Jun 23, 2020 at 08:27:52PM -0700, Chaitanya Kulkarni wrote: > There are many places where trace API accepts the struct request_queue* > parameter which can be derived from other function parameters. > > This patch removes the struct request queue parameter from the > blktrace framework

[dm-devel] [PATCH 09/14] block: move the initial blkg lookup into blkg_tryget_closest

2020-06-27 Thread Christoph Hellwig
By moving the initial blkg lookup into blkg_tryget_closest we get a nicely self contained routines that does all the RCU locking. Signed-off-by: Christoph Hellwig --- block/blk-cgroup.c | 33 ++--- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/block

[dm-devel] [PATCH 10/14] blk-cgroup: remove the !bio->bi_blkg check in blkcg_bio_issue_check

2020-06-27 Thread Christoph Hellwig
This is purely a sanity check for grave programming errors. Remove it to simplify further work in this area. Signed-off-by: Christoph Hellwig --- include/linux/blk-cgroup.h | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/include/linux/blk-cgroup.h b/include

[dm-devel] [PATCH 12/14] blk-cgroup: move rcu locking from blkcg_bio_issue_check to blk_throtl_bio

2020-06-27 Thread Christoph Hellwig
The only thing in blkcg_bio_issue_check that needs to be under rcu_read_lock is blk_throtl_bio, so move the locking there. Signed-off-by: Christoph Hellwig --- block/blk-throttle.c | 3 ++- include/linux/blk-cgroup.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git

[dm-devel] [PATCH 14/14] blk-cgroup: remove a dead check in blk_throtl_bio

2020-06-27 Thread Christoph Hellwig
bios must have a valid block group by the time they are submitted. Signed-off-by: Christoph Hellwig --- block/blk-throttle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 9d00f62c05ecdf..ad37043297ed58 100644 --- a/block

[dm-devel] [PATCH 06/14] block: move the bio cgroup associatation helpers to blk-cgroup.c

2020-06-27 Thread Christoph Hellwig
Keep the cgroup code together. Signed-off-by: Christoph Hellwig --- block/bio.c| 75 --- block/blk-cgroup.c | 103 - include/linux/blk-cgroup.h | 30 --- 3 files changed, 101 insertions(+), 107

[dm-devel] drive-by blk-cgroup cleanups

2020-06-27 Thread Christoph Hellwig
Hi all, while looking into another "project" I ended up wading through the blkcq code for research and found a bunch of lose ends. So here is a bunch of drive-by cleanups for the code. Diffstat: block/bio.c| 143 +-- block/blk-cgroup.c |

[dm-devel] [PATCH 13/14] blk-cgroup: remove blkcg_bio_issue_check

2020-06-27 Thread Christoph Hellwig
builds. Signed-off-by: Christoph Hellwig --- block/blk-cgroup.c | 34 +++ block/blk-core.c | 7 - block/blk-throttle.c | 5 ++-- block/blk.h| 2 ++ include/linux/blk-cgroup.h | 56 ++ 5 files

[dm-devel] [PATCH 04/14] block: merge __bio_associate_blkg into bio_associate_blkg_from_css

2020-06-27 Thread Christoph Hellwig
Merge __bio_associate_blkg into the only caller, which allows to slightly reduce the RCU crticial section and better explain the code flow. Signed-off-by: Christoph Hellwig --- block/bio.c | 45 + 1 file changed, 13 insertions(+), 32 deletions

[dm-devel] [PATCH 11/14] cgroup: unexport cgroup_rstat_updated

2020-06-27 Thread Christoph Hellwig
cgroup_rstat_updated is only used by core block code, no need to export it. Signed-off-by: Christoph Hellwig --- kernel/cgroup/rstat.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c index b6397a186ce9c8..d51175cedfca4f 100644 --- a/kernel/cgroup

[dm-devel] [PATCH 03/14] block: really clone the block cgroup in bio_clone_blkg_association

2020-06-27 Thread Christoph Hellwig
. Signed-off-by: Christoph Hellwig --- block/bio.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/block/bio.c b/block/bio.c index 8aef4460b32e0e..e1d01acce8070c 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1737,12 +1737,12 @@ EXPORT_SYMBOL_GPL(bio_associate_blkg

[dm-devel] [PATCH 05/14] block: move bio_associate_blkg_from_page to mm/page_io.c

2020-06-27 Thread Christoph Hellwig
bio_associate_blkg_from_page is a special purpose helper for swap bios that doesn't need access to bio internals. Move it to the swap code instead of having it in bio.c. Signed-off-by: Christoph Hellwig --- block/bio.c | 26 -- include/linux/bio.h | 7

[dm-devel] [PATCH 07/14] block: merge blkg_lookup_create and __blkg_lookup_create

2020-06-27 Thread Christoph Hellwig
No good reason to keep these two functions split. Signed-off-by: Christoph Hellwig --- block/blk-cgroup.c | 49 +- 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index bb0607bfd771cd

[dm-devel] [PATCH 01/14] dm: use bio_uninit instead of bio_disassociate_blkg

2020-06-27 Thread Christoph Hellwig
to the two callers of __send_empty_flush, so that they better pair with the bio_init calls used to initialize them. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 109e81f33edb2d

[dm-devel] [PATCH 08/14] block: bypass blkg_tryget_closest for the root_blkg

2020-06-27 Thread Christoph Hellwig
The root_blkg is only torn down at the very end of removing a queue. So in the I/O submission path is always has a life reference and we can just grab another one using blkg_get instead of doing a tryget and parent walk that won't lead anywhere. Signed-off-by: Christoph Hellwig --- block/blk

[dm-devel] [PATCH 02/14] block: remove bio_disassociate_blkg

2020-06-27 Thread Christoph Hellwig
bio_disassociate_blkg has two callers, of which one immediately assigns a new value to >bi_blkg. Just open code the function in the two callers. Signed-off-by: Christoph Hellwig --- block/bio.c | 27 --- include/linux/bio.h | 2 -- 2 files changed, 8 inserti

Re: [dm-devel] drive-by blk-cgroup cleanups

2020-06-29 Thread Christoph Hellwig
On Mon, Jun 29, 2020 at 08:05:07AM +, Johannes Thumshirn wrote: > Btw what ever happened to > https://lore.kernel.org/r/20200430150356.35691-1-johannes.thumsh...@wdc.com? You'll have to ask Jens :) Note that your patch 2 overlaps with this series. I thik my version is a little nicer, given

[dm-devel] [PATCH 13/20] block: tidy up a warning in bio_check_ro

2020-06-29 Thread Christoph Hellwig
The "generic_make_request: " prefix has no value, and will soon become stale. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 76cfd5709f66cd..95dca74534ff73 100644 -

[dm-devel] [PATCH 10/20] dm: stop using ->queuedata

2020-06-29 Thread Christoph Hellwig
Instead of setting up the queuedata as well just use one private data field. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index e44473fe0f4873..c8d91f271c272e 100644 --- a/drivers/md

[dm-devel] [PATCH 14/20] block: remove the NULL queue check in generic_make_request_checks

2020-06-29 Thread Christoph Hellwig
All registers disks must have a valid queue pointer, so don't bother to log a warning for that case. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 95dca74534ff73

[dm-devel] [PATCH 04/20] null_blk: stop using ->queuedata for bio mode

2020-06-29 Thread Christoph Hellwig
Instead of setting up the queuedata as well just use one private data field. Signed-off-by: Christoph Hellwig --- drivers/block/null_blk_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c index 82259242b9b5c9

[dm-devel] [PATCH 20/20] block: remove direct_make_request

2020-06-29 Thread Christoph Hellwig
Now that submit_bio_noacct has a decent blk-mq fast path there is no more need for this bypass. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 28 drivers/md/dm.c | 5 + drivers/nvme/host/multipath.c | 2 +- include/linux

[dm-devel] [PATCH 09/20] bcache: stop setting ->queuedata

2020-06-29 Thread Christoph Hellwig
Nothing in bcache actually uses the ->queuedata field. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/super.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 2014016f9a60d3..21aa168113d30b 100644 --- a/drivers/md/bca

[dm-devel] [PATCH 11/20] fs: remove a weird comment in submit_bh_wbc

2020-06-29 Thread Christoph Hellwig
All bios can get remapped if submitted to partitions. No need to comment on that. Signed-off-by: Christoph Hellwig --- fs/buffer.c | 5 - 1 file changed, 5 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 64fe82ec65ff1f..2725ebbcfdc246 100644 --- a/fs/buffer.c +++ b/fs/buffer.c

[dm-devel] [PATCH 18/20] block: refator submit_bio_noacct

2020-06-29 Thread Christoph Hellwig
Split out a __submit_bio_noacct helper for the actual de-recursion algorithm, and simplify the loop by using a continue when we can't enter the queue for a bio. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 131 +-- 1 file changed, 71

[dm-devel] [PATCH 17/20] block: rename generic_make_request to submit_bio_noacct

2020-06-29 Thread Christoph Hellwig
generic_make_request has always been very confusingly misnamed, so rename it to submit_bio_noacct to make it clear that it is submit_bio minus accounting and a few checks. Signed-off-by: Christoph Hellwig --- Documentation/block/biodoc.rst| 2 +- .../fault-injection/fault

[dm-devel] [PATCH 12/20] block: remove the request_queue argument from blk_queue_split

2020-06-29 Thread Christoph Hellwig
The queue can be trivially derived from the bio, so pass one less argument. Signed-off-by: Christoph Hellwig --- block/blk-merge.c | 21 ++--- block/blk-mq.c| 2 +- block/blk.h | 3 +-- drivers/block/drbd/drbd_req.c | 2

[dm-devel] [PATCH 05/20] ps3vram: stop using ->queuedata

2020-06-29 Thread Christoph Hellwig
Instead of setting up the queuedata as well just use one private data field. Signed-off-by: Christoph Hellwig --- drivers/block/ps3vram.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c index 821d4d8b1d763e..5a1d1d137c7248

[dm-devel] [PATCH 15/20] block: remove the nr_sectors variable in generic_make_request_checks

2020-06-29 Thread Christoph Hellwig
The variable is only used once, so just open code the bio_sector() there. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 37435d0d433564..28f60985dc75cc 100644 --- a/block/blk

[dm-devel] [PATCH 01/20] nfblock: stop using ->queuedata

2020-06-29 Thread Christoph Hellwig
Instead of setting up the queuedata as well just use one private data field. Signed-off-by: Christoph Hellwig --- arch/m68k/emu/nfblock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/m68k/emu/nfblock.c b/arch/m68k/emu/nfblock.c index c3a630440512e9..87e8b1700acd28

[dm-devel] [PATCH 16/20] block: move ->make_request_fn to struct block_device_operations

2020-06-29 Thread Christoph Hellwig
be derived pretty trivially from the bio. Signed-off-by: Christoph Hellwig --- Documentation/block/biodoc.rst| 2 +- .../block/writeback_cache_control.rst | 2 +- arch/m68k/emu/nfblock.c | 5 +- arch/xtensa/platforms/iss/simdisk.c | 5

[dm-devel] [PATCH 08/20] zram: stop using ->queuedata

2020-06-29 Thread Christoph Hellwig
Instead of setting up the queuedata as well just use one private data field. Signed-off-by: Christoph Hellwig --- drivers/block/zram/zram_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index

[dm-devel] [PATCH 02/20] simdisk: stop using ->queuedata

2020-06-29 Thread Christoph Hellwig
Instead of setting up the queuedata as well just use one private data field. Signed-off-by: Christoph Hellwig --- arch/xtensa/platforms/iss/simdisk.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/xtensa/platforms/iss/simdisk.c b/arch/xtensa/platforms/iss/simdisk.c

[dm-devel] [PATCH 07/20] umem: stop using ->queuedata

2020-06-29 Thread Christoph Hellwig
Instead of setting up the queuedata as well just use one private data field. Signed-off-by: Christoph Hellwig --- drivers/block/umem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/umem.c b/drivers/block/umem.c index 1e2aa5ae27963c..5498f1cf36b3fe 100644

[dm-devel] rename ->make_request_fn and move it to the block_device_operations

2020-06-29 Thread Christoph Hellwig
Hi Jens, this series moves the make_request_fn method into block_device_operations with the much more descriptive ->submit_bio name. It then also gives generic_make_request a more descriptive name, and further optimize the path to issue to blk-mq, removing the need for the direct_make_request

[dm-devel] [PATCH 06/20] rsxx: stop using ->queuedata

2020-06-29 Thread Christoph Hellwig
Instead of setting up the queuedata as well just use one private data field. Signed-off-by: Christoph Hellwig --- drivers/block/rsxx/dev.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/block/rsxx/dev.c b/drivers/block/rsxx/dev.c index 3ba07ab30c84f5

[dm-devel] [PATCH 03/20] drbd: stop using ->queuedata

2020-06-29 Thread Christoph Hellwig
Instead of setting up the queuedata as well just use one private data field. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_main.c | 1 - drivers/block/drbd/drbd_req.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers

[dm-devel] [PATCH 19/20] block: shortcut __submit_bio_noacct for blk-mq drivers

2020-06-29 Thread Christoph Hellwig
For blk-mq drivers bios can only be inserted for the same queue. So bypass the complicated sorting logic in __submit_bio_noacct with a blk-mq simpler submission helper. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 50 +--- 1 file changed

Re: [dm-devel] [PATCH RFC 1/3] block: add flag 'nowait_requests' into queue limits

2020-06-02 Thread Christoph Hellwig
On Mon, Jun 01, 2020 at 03:37:09PM +0300, Konstantin Khlebnikov wrote: > Add flag for marking bio-based queues which support REQ_NOWAIT. > Set for all request based (mq) devices. > > Stacking device should set it after blk_set_stacking_limits() if method > make_request() itself doesn't delay

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