Re: [PATCH] block: remove bio_rewind_iter()

2018-09-04 Thread Kent Overstreet
o into its original > state via saving bio iterator(struct bvec_iter) in bio_integrity_prep(), > given now bio_rewind_iter() is only used by bio integrity code. > > Suggested-by: Kent Overstreet > Cc: Kent Overstreet > Cc: Dmitry Monakhov > Cc: Christoph Hellwig > Cc: Hannes Reinecke > Signed-off-by: Ming Lei Acked-by: Kent Overstreet

bvec_iter rewind API

2018-08-28 Thread Kent Overstreet
I just came across bi_done and your patch that added it - f9df1cd99e bio: add bvec_iter rewind API I invite you to think through what happens to a bio that gets split by something further down the stack, and then rewound after completion: To create the first half of the split, you just truncate

Re: [PATCH] block: Make __bio_clone_fast() copy bi_vcnt

2018-06-30 Thread Kent Overstreet
On Fri, Jun 29, 2018 at 01:00:33PM -0700, Bart Van Assche wrote: > On 06/28/18 17:04, Kent Overstreet wrote: > > On Thu, Jun 28, 2018 at 04:54:44PM -0700, Bart Van Assche wrote: > > > Thanks for chiming in. The linux-block mailing list is archived by > > > multiple &

Re: [PATCH] block: Make __bio_clone_fast() copy bi_vcnt

2018-06-28 Thread Kent Overstreet
On Thu, Jun 28, 2018 at 04:54:44PM -0700, Bart Van Assche wrote: > On 06/28/18 16:16, Kent Overstreet wrote: > > On Fri, Jun 29, 2018 at 07:10:47AM +0800, Ming Lei wrote: > > > On Thu, Jun 28, 2018 at 11:21 PM, Bart Van Assche > > > wrote: > > >

Re: [PATCH] block: Make __bio_clone_fast() copy bi_vcnt

2018-06-28 Thread Kent Overstreet
On Fri, Jun 29, 2018 at 07:10:47AM +0800, Ming Lei wrote: > On Thu, Jun 28, 2018 at 11:21 PM, Bart Van Assche > wrote: > > On 06/27/18 17:30, Ming Lei wrote: > >> > >> One core idea of immutable bvec is to use bio->bi_iter and the original > >> bvec table to iterate over anywhere in the bio. That

Re: [RFC] cleanup bcache bio handling

2018-06-13 Thread Kent Overstreet
On Wed, Jun 13, 2018 at 03:56:32PM +0200, Christoph Hellwig wrote: > On Wed, Jun 13, 2018 at 07:06:41PM +0800, Ming Lei wrote: > > > before bio_alloc_pages) that can be switched to something that just > > > creates a > > > single bvec. > > > > Yes, multipage bvec shouldn't break any driver or

Re: [PATCH 1/6] block: add a bio_reuse helper

2018-06-13 Thread Kent Overstreet
On Wed, Jun 13, 2018 at 03:59:15PM +0200, Christoph Hellwig wrote: > On Wed, Jun 13, 2018 at 04:54:41AM -0400, Kent Overstreet wrote: > > bi_size is not immutable though, it will usually be modified by drivers > > when you > > submit a bio. > > > > I see w

Re: [RFC] cleanup bcache bio handling

2018-06-13 Thread Kent Overstreet
On Mon, Jun 11, 2018 at 09:48:00PM +0200, Christoph Hellwig wrote: > Hi all, > > this series cleans up various places where bcache is way too intimate > with bio internals. This is intended as a baseline for the multi-page > biovec work, which requires some nasty workarounds for the existing >

Re: [PATCH 1/6] block: add a bio_reuse helper

2018-06-13 Thread Kent Overstreet
On Wed, Jun 13, 2018 at 09:32:04AM +0200, Christoph Hellwig wrote: > On Tue, Jun 12, 2018 at 02:16:30AM -0400, Kent Overstreet wrote: > > On Mon, Jun 11, 2018 at 09:48:01PM +0200, Christoph Hellwig wrote: > > > This abstracts out a way to reuse a bio without destroying the &

Re: [PATCH 1/6] block: add a bio_reuse helper

2018-06-12 Thread Kent Overstreet
On Mon, Jun 11, 2018 at 09:48:01PM +0200, Christoph Hellwig wrote: > This abstracts out a way to reuse a bio without destroying the > data pointers. What is the point of this? What "data pointers" does it not destroy? > > Signed-off-by: Christoph Hellwig > --- > block/bio.c | 20

Re: [GIT PULL] Block changes for 4.18-rc

2018-06-04 Thread Kent Overstreet
On Mon, Jun 04, 2018 at 05:42:04PM -0700, Linus Torvalds wrote: > On Mon, Jun 4, 2018 at 12:04 PM Kent Overstreet > wrote: > > > > However, that's not correct as is because mddev_delayed_put() calls > > kobject_put(), and the kobject isn't initialized when the mddev is f

Re: [GIT PULL] Block changes for 4.18-rc

2018-06-04 Thread Kent Overstreet
On Tue, Jun 05, 2018 at 08:52:32AM +1000, NeilBrown wrote: > On Mon, Jun 04 2018, Kent Overstreet wrote: > > > On Tue, Jun 05, 2018 at 07:16:51AM +1000, NeilBrown wrote: > >> I really should get back to BIOSET_NEED_RESCUER and see if I can discard > >> it co

Re: [PATCH] Revert "block: Add warning for bi_next not NULL in bio_endio()"

2018-06-04 Thread Kent Overstreet
On Mon, Jun 04, 2018 at 08:59:39AM +, Bart Van Assche wrote: > On Tue, 2018-05-22 at 22:16 -0400, Kent Overstreet wrote: > > May 22 22:13:46 moria-kvm-kvm-kvm-kvm multipathd[387]: sda: fail to get > > serial > > May 22 22:13:46 moria-kvm-kvm-kvm-kvm multipathd[387]:

Re: [GIT PULL] Block changes for 4.18-rc

2018-06-04 Thread Kent Overstreet
On Tue, Jun 05, 2018 at 07:16:51AM +1000, NeilBrown wrote: > I really should get back to BIOSET_NEED_RESCUER and see if I can discard > it completely. > Kent - the only remaining user is bcache, and the main reason I haven't > removed it is that I cannot follow the code (or at least, I couldn't >

Re: [GIT PULL] Block changes for 4.18-rc

2018-06-04 Thread Kent Overstreet
On Mon, Jun 04, 2018 at 12:25:54PM -0600, Jens Axboe wrote: > On 6/4/18 12:22 PM, Linus Torvalds wrote: > > On Mon, Jun 4, 2018 at 11:20 AM Tejun Heo wrote: > >> > >> > >> Looking at the code, the fundamental problem seems to be that it's > >> weaving different parts of sync and async paths. I

Re: [RESEND PATCH V5 00/33] block: support multipage bvec

2018-05-24 Thread Kent Overstreet
On Fri, May 25, 2018 at 11:45:48AM +0800, Ming Lei wrote: > Hi, > > This patchset brings multipage bvec into block layer: patch series looks sane to me. goddamn that's a lot of renaming. Things are going to get interesting when we start sticking compound pages in the page cache, there'll be

Re: [RESEND PATCH V5 12/33] block: introduce bio_segments()

2018-05-24 Thread Kent Overstreet
On Fri, May 25, 2018 at 11:46:00AM +0800, Ming Lei wrote: > There are still cases in which we need to use bio_segments() for get the > number of segment, so introduce it. > > Signed-off-by: Ming Lei > --- > include/linux/bio.h | 25 - > 1 file

Re: [PATCH] Revert "block: Add warning for bi_next not NULL in bio_endio()"

2018-05-22 Thread Kent Overstreet
On Wed, May 23, 2018 at 01:36:02AM +, Bart Van Assche wrote: > On Tue, 2018-05-22 at 21:30 -0400, Kent Overstreet wrote: > > On Tue, May 22, 2018 at 04:55:05PM -0700, Bart Van Assche wrote: > > > This patch avoids that KASAN reports the following complaint when > >

Re: [PATCH] Revert "block: Add warning for bi_next not NULL in bio_endio()"

2018-05-22 Thread Kent Overstreet
On Tue, May 22, 2018 at 04:55:05PM -0700, Bart Van Assche wrote: > This patch avoids that KASAN reports the following complaint when > running the srp-test software: I made a real attempt to get your test suite working. It would be nice if you could make an attempt at tracking it down instead of

Re: [PATCH v2] lib/crc64.c: add license information

2018-05-22 Thread Kent Overstreet
Postgresql is under its own license, which is basically the BSD license under a different name. I don't know if there's precedent for calling that BSD or if you should just say the postgresql license. On Tue, May 22, 2018 at 5:55 AM, Coly Li wrote: > On 2018/5/22 5:53 PM, Andy

Re: [PATCH 00/13] convert block layer to bioset_init()/mempool_init()

2018-05-21 Thread Kent Overstreet
On Mon, May 21, 2018 at 02:24:32PM -0400, Mike Snitzer wrote: > Every single data structure change in this series should be reviewed for > unforeseen alignment consequences. Jens seemed to say that is > worthwhile. Not sure if he'll do it or we divide it up. If we divide > it up a temp topic

Re: [PATCH 00/13] convert block layer to bioset_init()/mempool_init()

2018-05-21 Thread Kent Overstreet
On Mon, May 21, 2018 at 12:09:14PM -0400, Mike Snitzer wrote: > On Mon, May 21 2018 at 11:36am -0400, > Jens Axboe wrote: > > > On 5/21/18 9:18 AM, Mike Snitzer wrote: > > > On Mon, May 21 2018 at 11:09am -0400, > > > Jens Axboe wrote: > > > > > >> On 5/21/18

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-20 Thread Kent Overstreet
On Sun, May 20, 2018 at 11:40:45PM +, Bart Van Assche wrote: > On Sun, 2018-05-20 at 19:21 -0400, Kent Overstreet wrote: > > I really have better things to do than debug someone else's tests... > > [ ... ] > > ../run_tests: line 65: cd: /lib/modules/4.16.0+/kerne

[PATCH 06/12] md: convert to bioset_init()/mempool_init()

2018-05-20 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- Resend, including Shaohua Li: drivers/md/md-faulty.c| 2 +- drivers/md/md-linear.c| 2 +- drivers/md/md-multipath.c | 17 - drivers/md/md-multipath.h | 2 +- drivers/md/md.c

Re: [PATCH 00/13] convert block layer to bioset_init()/mempool_init()

2018-05-20 Thread Kent Overstreet
Thanks - sending it to him On Sun, May 20, 2018 at 7:08 PM, NeilBrown <ne...@suse.com> wrote: > On Sun, May 20 2018, Kent Overstreet wrote: > >> Jens - this series does the rest of the conversions that Christoph wanted, >> and >> drops bioset_create(). >> >

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-20 Thread Kent Overstreet
On Sun, May 20, 2018 at 10:35:29PM +, Bart Van Assche wrote: > On Sun, 2018-05-20 at 18:31 -0400, Kent Overstreet wrote: > > On Sun, May 20, 2018 at 10:19:13PM +, Bart Van Assche wrote: > > > On Sun, 2018-05-20 at 18:17 -0400, Kent Overstreet wrote: > > > >

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-20 Thread Kent Overstreet
On Sun, May 20, 2018 at 10:19:13PM +, Bart Van Assche wrote: > On Sun, 2018-05-20 at 18:17 -0400, Kent Overstreet wrote: > > On Fri, May 18, 2018 at 03:12:27PM +, Bart Van Assche wrote: > > > On Fri, 2018-05-18 at 05:06 -0400, Kent Overstreet wrote: > > > >

[PATCH 01/12] block: convert bounce, q->bio_split to bioset_init()/mempool_init()

2018-05-20 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/blk-core.c | 7 --- block/blk-merge.c | 8 +++ block/blk-sysfs.c | 3 +-- block/bounce.c | 47 ++ drivers/md/dm.c| 2 +- include/linux

[PATCH 00/13] convert block layer to bioset_init()/mempool_init()

2018-05-20 Thread Kent Overstreet
Jens - this series does the rest of the conversions that Christoph wanted, and drops bioset_create(). Only lightly tested, but the changes are pretty mechanical. Based on your for-next tree. It's also in the for-jens branch at https://evilpiepirate.org/git/bcachefs.git Kent Overstreet (12

[PATCH 04/12] lightnvm: convert to bioset_init()/mempool_init()

2018-05-20 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- drivers/lightnvm/pblk-core.c | 30 ++--- drivers/lightnvm/pblk-init.c | 72 drivers/lightnvm/pblk-read.c | 4 +- drivers/lightnvm/pblk-recovery.c | 2 +- drivers/lightnv

[PATCH 05/12] bcache: convert to bioset_init()/mempool_init()

2018-05-20 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- drivers/md/bcache/bcache.h | 10 +- drivers/md/bcache/bset.c| 13 - drivers/md/bcache/bset.h| 2 +- drivers/md/bcache/btree.c | 4 ++-- drivers/md/bcache/io.c | 4 ++-- drivers/md/

[PATCH 02/12] drbd: convert to bioset_init()/mempool_init()

2018-05-20 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- drivers/block/drbd/drbd_bitmap.c | 4 +- drivers/block/drbd/drbd_int.h | 10 ++--- drivers/block/drbd/drbd_main.c | 71 +++--- drivers/block/drbd/drbd_receiver.c | 6 +-- drivers/bloc

[PATCH 03/12] pktcdvd: convert to bioset_init()/mempool_init()

2018-05-20 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- drivers/block/pktcdvd.c | 50 - include/linux/pktcdvd.h | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c

[PATCH 07/12] dm: convert to bioset_init()/mempool_init()

2018-05-20 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- drivers/md/dm-bio-prison-v1.c | 13 --- drivers/md/dm-bio-prison-v2.c | 13 --- drivers/md/dm-cache-target.c | 25 ++--- drivers/md/dm-core.h | 4 +- drivers/md/dm-c

[PATCH 08/12] target: convert to bioset_init()/mempool_init()

2018-05-20 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- drivers/target/target_core_iblock.c | 14 ++ drivers/target/target_core_iblock.h | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/target/target_core_iblock.c b/drivers/

[PATCH 10/12] btrfs: convert to bioset_init()/mempool_init()

2018-05-20 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- fs/btrfs/extent_io.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index e99b329002..56d32bb462 100644 --- a/fs/btrfs/extent_io.c ++

[PATCH 11/12] xfs: convert to bioset_init()/mempool_init()

2018-05-20 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- fs/xfs/xfs_aops.c | 2 +- fs/xfs/xfs_aops.h | 2 +- fs/xfs/xfs_super.c | 11 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 0ab824f574..102463543d

[PATCH 12/12] block: Drop bioset_create()

2018-05-20 Thread Kent Overstreet
All users have been converted to bioset_init() Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 61 ++--- include/linux/bio.h | 6 ++--- 2 files changed, 15 insertions(+), 52 deletions(-) diff --git a/block/b

[PATCH 09/12] fs: convert block_dev.c to bioset_init()

2018-05-20 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- fs/block_dev.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 7ec920e270..b550ae280f 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -272,7 +272,7 @@

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-20 Thread Kent Overstreet
On Fri, May 18, 2018 at 03:12:27PM +, Bart Van Assche wrote: > On Fri, 2018-05-18 at 05:06 -0400, Kent Overstreet wrote: > > On Thu, May 17, 2018 at 08:54:57PM +, Bart Van Assche wrote: > > > With Jens' latest for-next branch I hit the kernel warning shown below. > &

Re: [PATCH 02/10] block: Convert bio_set to mempool_init()

2018-05-18 Thread Kent Overstreet
On Fri, May 18, 2018 at 09:20:28AM -0700, Christoph Hellwig wrote: > On Tue, May 08, 2018 at 09:33:50PM -0400, Kent Overstreet wrote: > > Minor performance improvement by getting rid of pointer indirections > > from allocation/freeing fastpaths. > > Can you please also s

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-18 Thread Kent Overstreet
On Thu, May 17, 2018 at 08:54:57PM +, Bart Van Assche wrote: > On Tue, 2018-05-08 at 21:33 -0400, Kent Overstreet wrote: > > [ ... ] > > Hello Kent, > > With Jens' latest for-next branch I hit the kernel warning shown below. Can > you have a look? Any hints on how to

[PATCH 02/10] block: Convert bio_set to mempool_init()

2018-05-18 Thread Kent Overstreet
Minor performance improvement by getting rid of pointer indirections from allocation/freeing fastpaths. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio-integrity.c | 29 ++--- block/bio.c

[PATCH 01/10] mempool: Add mempool_init()/mempool_exit()

2018-05-18 Thread Kent Overstreet
Allows mempools to be embedded in other structs, getting rid of a pointer indirection from allocation fastpaths. mempool_exit() is safe to call on an uninitialized but zeroed mempool. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- include/linux/mempool.h | 34 +++

[PATCH 03/10] block: Add bioset_init()/bioset_exit()

2018-05-18 Thread Kent Overstreet
Similarly to mempool_init()/mempool_exit(), take a pointer indirection out of allocation/freeing by allowing biosets to be embedded in other structs. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 93 +++-- i

[PATCH 04/10] block: Use bioset_init() for fs_bio_set

2018-05-18 Thread Kent Overstreet
Minor optimization - remove a pointer indirection when using fs_bio_set. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 7 +++ block/blk-core.c| 2 +- drivers/target/target_core_iblock.c | 2 +- include/linux

[PATCH 05/10] block: Add bio_copy_data_iter(), zero_fill_bio_iter()

2018-05-18 Thread Kent Overstreet
Add versions that take bvec_iter args instead of using bio->bi_iter - to be used by bcachefs. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 44 include/linux/bio.h | 18 +++--- 2 files ch

[PATCH 06/10] block: Split out bio_list_copy_data()

2018-05-18 Thread Kent Overstreet
this in the future. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 83 + drivers/block/pktcdvd.c | 2 +- include/linux/bio.h | 5 ++- 3 files changed, 55 insertions(+), 35 deletions(-) diff --git a/block

[PATCH 07/10] block: Add missing flush_dcache_page() call

2018-05-18 Thread Kent Overstreet
Since a bio can point to userspace pages (e.g. direct IO), this is generally necessary. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/bio.c b/block/bio.c index c58544d4bc..ce8e259f9a 100644 --- a/block

[PATCH 09/10] block: Export bio check/set pages_dirty

2018-05-18 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/bio.c b/block/bio.c index 5c81391100..6689102f5d 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1610,6 +1610,7 @@ void bio_set_pages_dirty(struct bi

[PATCH 08/10] block: Add warning for bi_next not NULL in bio_endio()

2018-05-18 Thread Kent Overstreet
in weird ways, add a warning to help avoid more bugs like that in the future. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 3 +++ block/blk-core.c | 8 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/block/bio.c b/block/bio.c

[PATCH 10/10] block: Add sysfs entry for fua support

2018-05-18 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/blk-sysfs.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index cbea895a55..d6dd7d8198 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -497,6 +497,11 @@

Re: [PATCH v3] bcache: return 0 from bch_debug_init() if CONFIG_DEBUG_FS=n

2018-05-17 Thread Kent Overstreet
it()") > Cc: sta...@vger.kernel.org > Signed-off-by: Coly Li <col...@suse.de> > Reported-by: Massimo B. <massim...@gmx.net> > Reported-by: Kai Krakow <k...@kaishome.de> > Tested-by: Kai Krakow <k...@kaishome.de> > Cc: Kent Overstreet <kent.overstr...@gmail.com> Acked-by: Kent Overstreet <kent.overstr...@gmail.com>

Re: [PATCH v2] bcache: return 0 from bch_debug_init() if CONFIG_DEBUG_FS=n

2018-05-17 Thread Kent Overstreet
it()") > Cc: sta...@vger.kernel.org > Signed-off-by: Coly Li <col...@suse.de> > Reported-by: Massimo B. <massim...@gmx.net> > Reported-by: Kai Krakow <k...@kaishome.de> > Tested-by: Kai Krakow <k...@kaishome.de> > Cc: Kent Overstreet <kent.ove

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-14 Thread Kent Overstreet
Thanks! On Mon, May 14, 2018 at 3:24 PM, Jens Axboe <ax...@kernel.dk> wrote: > On 5/8/18 7:33 PM, Kent Overstreet wrote: >> - Add separately allowed mempools, biosets: bcachefs uses both all over the >>place >> >> - Bit of utility code - bio_cop

Re: [PATCH 01/10] mempool: Add mempool_init()/mempool_exit()

2018-05-14 Thread Kent Overstreet
On Fri, May 11, 2018 at 03:11:45PM -0600, Jens Axboe wrote: > On 5/8/18 7:33 PM, Kent Overstreet wrote: > > Allows mempools to be embedded in other structs, getting rid of a > > pointer indirection from allocation fastpaths. > > > > mempool_exit() is safe to call on

[PATCH 04/10] block: Use bioset_init() for fs_bio_set

2018-05-08 Thread Kent Overstreet
Minor optimization - remove a pointer indirection when using fs_bio_set. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 7 +++ block/blk-core.c| 2 +- drivers/target/target_core_iblock.c | 2 +- include/linux

[PATCH 01/10] mempool: Add mempool_init()/mempool_exit()

2018-05-08 Thread Kent Overstreet
Allows mempools to be embedded in other structs, getting rid of a pointer indirection from allocation fastpaths. mempool_exit() is safe to call on an uninitialized but zeroed mempool. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- include/linux/mempool.h | 34 +++

[PATCH 05/10] block: Add bio_copy_data_iter(), zero_fill_bio_iter()

2018-05-08 Thread Kent Overstreet
Add versions that take bvec_iter args instead of using bio->bi_iter - to be used by bcachefs. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 44 include/linux/bio.h | 18 +++--- 2 files ch

[PATCH 03/10] block: Add bioset_init()/bioset_exit()

2018-05-08 Thread Kent Overstreet
Similarly to mempool_init()/mempool_exit(), take a pointer indirection out of allocation/freeing by allowing biosets to be embedded in other structs. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 93 +++-- i

[PATCH 06/10] block: Split out bio_list_copy_data()

2018-05-08 Thread Kent Overstreet
this in the future. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 83 + drivers/block/pktcdvd.c | 2 +- include/linux/bio.h | 5 ++- 3 files changed, 55 insertions(+), 35 deletions(-) diff --git a/block

[PATCH 10/10] block: Add sysfs entry for fua support

2018-05-08 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/blk-sysfs.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index cbea895a55..d6dd7d8198 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -497,6 +497,11 @@

[PATCH 09/10] block: Export bio check/set pages_dirty

2018-05-08 Thread Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/bio.c b/block/bio.c index 5c81391100..6689102f5d 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1610,6 +1610,7 @@ void bio_set_pages_dirty(struct bi

[PATCH 08/10] block: Add warning for bi_next not NULL in bio_endio()

2018-05-08 Thread Kent Overstreet
in weird ways, add a warning to help avoid more bugs like that in the future. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 3 +++ block/blk-core.c | 8 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/block/bio.c b/block/bio.c

[PATCH 07/10] block: Add missing flush_dcache_page() call

2018-05-08 Thread Kent Overstreet
Since a bio can point to userspace pages (e.g. direct IO), this is generally necessary. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/bio.c b/block/bio.c index c58544d4bc..ce8e259f9a 100644 --- a/block

[PATCH 02/10] block: Convert bio_set to mempool_init()

2018-05-08 Thread Kent Overstreet
Minor performance improvement by getting rid of pointer indirections from allocation/freeing fastpaths. Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio-integrity.c | 29 ++--- block/bio.c

[PATCH 00/10] Misc block layer patches for bcachefs

2018-05-08 Thread Kent Overstreet
, because bcachefs does dio its own way - show whether fua is supported in sysfs, because I don't know of anything that exports whether the _block layer_ specifically thinks fua is supported. Kent Overstreet (10): mempool: Add mempool_init()/mempool_exit() block: Convert bio_set to mempool_init

Re: [PATCH] bcache: lock in btree_flush_write() to avoid races

2018-01-24 Thread Kent Overstreet
The only purpose of rcu_read_lock() would be to ensure the object isn't freed out from under you. That's not an issue here. Racing with other writers isn't a correctness issue here, and if it was - just throwing write_lock around where you have it wouldn't be sufficient, you'd need something much

Re: [for-416 PATCH 1/2] bcache: Fix, improve efficiency of closure_sync()

2018-01-05 Thread Kent Overstreet
On Fri, Jan 05, 2018 at 09:15:41AM -0800, Michael Lyle wrote: > Jens & Kent, > > On 01/05/2018 08:05 AM, Jens Axboe wrote: > > On 12/30/17 4:09 PM, Michael Lyle wrote: > >> +void __closure_sync(struct closure *cl) > >> +{ > >> + struct closure_syncer s = { .task = current }; > >> > >> + cl->s

Re: [PATCH] bcache: add a separate open bucket list for flash devices

2017-11-21 Thread Kent Overstreet
On Tue, Nov 21, 2017 at 10:48:27PM +0800, Coly Li wrote: > On 21/11/2017 6:57 PM, Kent Overstreet wrote: > > On Tue, Nov 21, 2017 at 06:50:32PM +0800, tang.jun...@zte.com.cn wrote: > >> From: Tang Junhui <tang.jun...@zte.com.cn> > >> > >> Currently in p

Re: [PATCH] bcache: add a separate open bucket list for flash devices

2017-11-21 Thread Kent Overstreet
On Tue, Nov 21, 2017 at 06:50:32PM +0800, tang.jun...@zte.com.cn wrote: > From: Tang Junhui > > Currently in pick_data_bucket(), though we keep multiple buckets open > for writes, and try to segregate different write streams for better > cache utilization: first we look

Re: [PATCH v2 2/2] bcache: rearrange writeback main thread ratelimit

2017-10-13 Thread Kent Overstreet
es, but it > may slightly increase the burstiness of writeback. The writeback > lock needs improvement to help mitigate this. > > Signed-off-by: Michael Lyle <ml...@lyle.org> Reviewed-by: Kent Overstreet <kent.overstr...@gmail.com> > --- > drivers/md/bcache/writ

Re: [PATCHv2] bcache: option for allow stale data on read failure

2017-09-20 Thread Kent Overstreet
) as disabled. Now people can make choices > for different situations. IMO this is just a bug, I'd rather not have an option to keep the buggy behaviour. How about this patch: commit 2746f9c1f962288d8c5d7dabe698bf7b3fddd405 Author: Kent Overstreet <kent.overstr...@gmail.com> Date: Wed Sep 20 18:

Re: [PATCH 09/11] bcache: use kmalloc to allocate bio in bch_data_verify()

2017-04-21 Thread Kent Overstreet
ways, so the usage is inconsistent. > > Change the bio_clone() to bio_clone_kmalloc() > so that no pool is used either for the bio or the pages. > > Signed-off-by: NeilBrown <ne...@suse.com> Acked-by: Kent Overstreet <kent.overstr...@gmail.com>` > --- > drivers/md/bcac

Re: v4.9, 4.4-final: 28 bioset threads on small notebook, 36 threads on cellphone

2017-02-09 Thread Kent Overstreet
On Wed, Feb 08, 2017 at 11:34:07AM -0500, Mike Snitzer wrote: > On Tue, Feb 07 2017 at 11:58pm -0500, > Kent Overstreet <kent.overstr...@gmail.com> wrote: > > > On Tue, Feb 07, 2017 at 09:39:11PM +0100, Pavel Machek wrote: > > > On Mon 2017-02-06 17:49:06, Kent Ov

Re: dm-crypt: fix lost ioprio when queuing crypto bios from task with ioprio

2016-12-18 Thread Kent Overstreet
On Sun, Dec 18, 2016 at 06:17:55PM -0500, Mike Snitzer wrote: > Spinning it as a pure bugfix is a reach (as Eric's header documents the > patch, the case is weak for cc'ing stable). Reality is the change is > needed to enable a new bcache feature. I'm not going to rush > feature-enabling change

Re: dm-crypt: fix lost ioprio when queuing crypto bios from task with ioprio

2016-12-18 Thread Kent Overstreet
On Sat, Dec 17, 2016 at 10:58:00AM -0500, Mike Snitzer wrote: > The time for 4.10 inclusion has passed. This needs to wait until 4.11. > > It also needs more review, testing and possible re-working. Each DM > target shouldn't have to worry about these details (though I do grant > that

Re: [PATCH 4/5] iomap: implement direct I/O

2016-11-05 Thread Kent Overstreet
ice as many pages as > the old direct I/O code did, which means that we will have a better > batch factor for everything but overwrites of badly fragmented files. > > Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Kent Overstreet <kent.overstr...@gmail.com> --

Re: [PATCH 28/60] block: introduce QUEUE_FLAG_SPLIT_MP

2016-11-03 Thread Kent Overstreet
On Thu, Nov 03, 2016 at 07:26:52PM +0800, Ming Lei wrote: > On Thu, Nov 3, 2016 at 7:20 PM, Kent Overstreet > <kent.overstr...@gmail.com> wrote: > > On Thu, Nov 03, 2016 at 06:38:57PM +0800, Ming Lei wrote: > >> On Wed, Nov 2, 2016 at 11:08 AM, Kent Overstreet >

Re: [PATCH 28/60] block: introduce QUEUE_FLAG_SPLIT_MP

2016-11-03 Thread Kent Overstreet
On Thu, Nov 03, 2016 at 06:38:57PM +0800, Ming Lei wrote: > On Wed, Nov 2, 2016 at 11:08 AM, Kent Overstreet > <kent.overstr...@gmail.com> wrote: > > On Mon, Oct 31, 2016 at 08:39:15AM -0700, Christoph Hellwig wrote: > >> On Sat, Oct 29, 2016 at 04:08:27PM +0800,

Re: [PATCH 09/60] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments

2016-11-01 Thread Kent Overstreet
On Mon, Oct 31, 2016 at 08:29:01AM -0700, Christoph Hellwig wrote: > On Sat, Oct 29, 2016 at 04:08:08PM +0800, Ming Lei wrote: > > Avoid to access .bi_vcnt directly, because it may be not what > > the driver expected any more after supporting multipage bvec. > > > > Signed-off-by: Ming Lei

Re: [PATCH 28/60] block: introduce QUEUE_FLAG_SPLIT_MP

2016-11-01 Thread Kent Overstreet
On Mon, Oct 31, 2016 at 08:39:15AM -0700, Christoph Hellwig wrote: > On Sat, Oct 29, 2016 at 04:08:27PM +0800, Ming Lei wrote: > > Some drivers(such as dm) should be capable of dealing with multipage > > bvec, but the incoming bio may be too big, such as, a new singlepage bvec > > bio can't be

Re: [PATCH 45/60] block: bio: introduce bio_for_each_segment_all_rd() and its write pair

2016-11-01 Thread Kent Overstreet
On Mon, Oct 31, 2016 at 08:11:23AM -0700, Christoph Hellwig wrote: > On Mon, Oct 31, 2016 at 09:59:43AM -0400, Theodore Ts'o wrote: > > What is _rd and _wt supposed to stand for? > > I think it's read and write, but I think the naming is highly > unfortunate. I started dabbling around with the

Re: [PATCH 5/6] iomap: implement direct I/O

2016-10-25 Thread Kent Overstreet
On Tue, Oct 25, 2016 at 05:08:17PM +0200, Christoph Hellwig wrote: > This adds a full fledget direct I/O implementation using the iomap > interface. Full fledged in this case means all features are supported: > AIO, vectored I/O, any iov_iter type including kernel pointers, bvecs > and pipes,

Re: [PATCH 5/6] iomap: implement direct I/O

2016-10-25 Thread Kent Overstreet
On Tue, Oct 25, 2016 at 06:34:43PM +0200, Christoph Hellwig wrote: > On Tue, Oct 25, 2016 at 07:31:56AM -0800, Kent Overstreet wrote: > Yes, this is the basic idea behind the whole iomap code - we have > a generic apply function that calls into the fs allocator, and then > take

Re: [PATCH] block: export bio_free_pages to other modules

2016-09-22 Thread Kent Overstreet
ig <h...@infradead.org> > Cc: Jens Axboe <ax...@fb.com> > Cc: Mike Snitzer <snit...@redhat.com> > Cc: Shaohua Li <s...@fb.com> > Cc: Kent Overstreet <kent.overstr...@gmail.com> > Signed-off-by: Guoqing Jiang <gqji...@suse.com> Acked-by: Kent Overstr

Re: [PATCH v4] block: make sure big bio is splitted into at most 256 bvecs

2016-08-24 Thread Kent Overstreet
912] [] ? generic_make_request+0xb5/0x155 > > [ 172.664947] [] ? prio_io+0x85/0x95 [bcache] > > [ 172.664981] [] ? register_cache_set+0x355/0x8d0 > > [bcache] > > [ 172.665016] [] ? register_bcache+0x1006/0x1174 > > [bcache] Acked-by: Kent Overstreet <kent.over

Re: [PATCH v3] block: make sure big bio is splitted into at most 256 bvecs

2016-08-15 Thread Kent Overstreet
On Mon, Aug 15, 2016 at 11:23:28AM -0700, Christoph Hellwig wrote: > On Mon, Aug 15, 2016 at 11:11:22PM +0800, Ming Lei wrote: > > After arbitrary bio size is supported, the incoming bio may > > be very big. We have to split the bio into small bios so that > > each holds at most BIO_MAX_PAGES

Re: [PATCH v2] block: make sure big bio is splitted into at most 256 bvecs

2016-08-12 Thread Kent Overstreet
On Thu, Aug 11, 2016 at 07:02:53AM -0700, Christoph Hellwig wrote: > Please just fix bcache to not submit bios larger than BIO_MAX_PAGES for > now, until we can support such callers in general and enable common > used code to do so. Christoph, what's wrong with Ming's patch? Leaving bcache aside,