[PATCH v8 7/8] block: Consolidate bio_alloc_bioset(), bio_kmalloc()

2012-09-06 Thread Kent Overstreet
(), bio_alloc_bioset(), and bio_kmalloc(). Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk v7: Re-add dropped comments, improv patch description --- fs/bio.c| 110 ++-- include/linux/bio.h | 16

[PATCH v9 3/9] dm: Use bioset's front_pad for dm_rq_clone_bio_info

2012-09-06 Thread Kent Overstreet
, but due to the way io_pool is used and overloaded this looks not quite trivial so I'm leaving it for a later patch. v6: Fix comment on struct dm_rq_clone_bio_info, per Tejun Signed-off-by: Kent Overstreet koverstr...@google.com CC: Alasdair Kergon a...@redhat.com Acked-by: Tejun Heo t...@kernel.org

[PATCH v9 9/9] block: Add bio_clone_bioset(), bio_clone_kmalloc()

2012-09-06 Thread Kent Overstreet
of the functionality the last patch adedd. This will also help in a later patch changing how bio cloning works. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de CC: Alasdair Kergon a...@redhat.com CC: Boaz Harrosh bharr...@panasas.com CC

[PATCH v9 8/9] block: Consolidate bio_alloc_bioset(), bio_kmalloc()

2012-09-06 Thread Kent Overstreet
(), bio_alloc_bioset(), and bio_kmalloc(). Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk v7: Re-add dropped comments, improv patch description --- fs/bio.c| 110 ++-- include/linux/bio.h | 16

[PATCH v8 8/8] block: Add bio_clone_bioset(), bio_clone_kmalloc()

2012-09-06 Thread Kent Overstreet
of the functionality the last patch adedd. This will also help in a later patch changing how bio cloning works. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de CC: Alasdair Kergon a...@redhat.com CC: Boaz Harrosh bharr...@panasas.com CC

[PATCH v9 7/9] block: Kill bi_destructor

2012-09-06 Thread Kent Overstreet
those a bit - move some code from bio_put() to bio_free() and kill the redundant bio-bi_next = NULL. v5: Switch to BIO_KMALLOC_POOL ((void *)~0), per Boaz v6: BIO_KMALLOC_POOL now NULL, drop bio_free's EXPORT_SYMBOL v7: No #define BIO_KMALLOC_POOL anymore Signed-off-by: Kent Overstreet koverstr

[PATCH v8 6/8] block: Kill bi_destructor

2012-09-06 Thread Kent Overstreet
place, refactor it a bit and pull out __bio_free() for bio_reset() to use. v5: Switch to BIO_KMALLOC_POOL ((void *)~0), per Boaz v6: BIO_KMALLOC_POOL now NULL, drop bio_free's EXPORT_SYMBOL v7: No #define BIO_KMALLOC_POOL anymore Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe

[PATCH v9 2/9] block: Ues bi_pool for bio_integrity_alloc()

2012-09-06 Thread Kent Overstreet
Now that bios keep track of where they were allocated from, bio_integrity_alloc_bioset() becomes redundant. Remove bio_integrity_alloc_bioset() and drop bio_set argument from the related functions and make them use bio-bi_pool. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe

[PATCH v9 6/9] block: Add bio_reset()

2012-09-06 Thread Kent Overstreet
v9: Add a function comment Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk Acked-by: Tejun Heo t...@kernel.org --- fs/bio.c | 24 1 file changed, 24 insertions(+) diff --git a/fs/bio.c b/fs/bio.c index 208141f..74ab3f0 100644 --- a/fs

[PATCH v9 5/9] pktcdvd: Switch to bio_kmalloc()

2012-09-06 Thread Kent Overstreet
This is prep work for killing bi_destructor - previously, pktcdvd had its own pkt_bio_alloc which was basically duplication bio_kmalloc(), necessitating its own bi_destructor implementation. v5: Un-reorder some functions, to make the patch easier to review Signed-off-by: Kent Overstreet koverstr

[PATCH v9 4/9] block: Add bio_reset()

2012-09-06 Thread Kent Overstreet
() and resetting bi_destructor. v5: Add a define BIO_RESET_BITS, to be very explicit about what parts of bio-bi_flags are saved. v6: Further commenting verbosity, per Tejun Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk Acked-by: Tejun Heo t...@kernel.org --- fs

[PATCH v9 1/9] block: Generalized bio pool freeing

2012-09-06 Thread Kent Overstreet
destructors unnecessary, so they're then deleted. v6: Explain the temporary if statement in bio_put Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de CC: Alasdair Kergon a...@redhat.com CC: Nicholas Bellinger n...@linux-iscsi.org CC: Lars

Re: [dm-devel] [PATCH v8 3/8] dm: Use bioset's front_pad for dm_rq_clone_bio_info

2012-09-06 Thread Kent Overstreet
On Thu, Sep 06, 2012 at 12:21:15PM +0900, Jun'ichi Nomura wrote: On 09/06/12 05:27, Kent Overstreet wrote: @@ -2718,7 +2705,8 @@ struct dm_md_mempools *dm_alloc_md_mempools(unsigned type, unsigned integrity) if (!pools-tio_pool) goto free_io_pool_and_out; - pools

[PATCH v10 3/8] dm: Use bioset's front_pad for dm_rq_clone_bio_info

2012-09-06 Thread Kent Overstreet
, but due to the way io_pool is used and overloaded this looks not quite trivial so I'm leaving it for a later patch. v6: Fix comment on struct dm_rq_clone_bio_info, per Tejun Signed-off-by: Kent Overstreet koverstr...@google.com CC: Alasdair Kergon a...@redhat.com Acked-by: Tejun Heo t...@kernel.org

[PATCH v10 4/8] block: Add bio_reset()

2012-09-06 Thread Kent Overstreet
v9: Add a function comment Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk Acked-by: Tejun Heo t...@kernel.org --- fs/bio.c | 24 include/linux/bio.h | 1 + include/linux/blk_types.h | 25

[PATCH v10 8/8] block: Add bio_clone_bioset(), bio_clone_kmalloc()

2012-09-06 Thread Kent Overstreet
of the functionality the last patch adedd. This will also help in a later patch changing how bio cloning works. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de CC: Alasdair Kergon a...@redhat.com CC: Boaz Harrosh bharr...@panasas.com CC

[PATCH v10 7/8] block: Consolidate bio_alloc_bioset(), bio_kmalloc()

2012-09-06 Thread Kent Overstreet
(), bio_alloc_bioset(), and bio_kmalloc(). Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk v7: Re-add dropped comments, improv patch description --- fs/bio.c| 110 ++-- include/linux/bio.h | 16

[PATCH v10 6/8] block: Kill bi_destructor

2012-09-06 Thread Kent Overstreet
those a bit - move some code from bio_put() to bio_free() and kill the redundant bio-bi_next = NULL. v5: Switch to BIO_KMALLOC_POOL ((void *)~0), per Boaz v6: BIO_KMALLOC_POOL now NULL, drop bio_free's EXPORT_SYMBOL v7: No #define BIO_KMALLOC_POOL anymore Signed-off-by: Kent Overstreet koverstr

[PATCH v10 0/8] Block cleanups

2012-09-06 Thread Kent Overstreet
Screwed up the bio_reset() patch in the last patch series when I went to edit the description, fixed that here. Only other change is the dm patch - made the front_pad conditional on DM_TYPE_BIO_BASED. Kent Overstreet (8): block: Generalized bio pool freeing block: Ues bi_pool

[PATCH v10 5/8] pktcdvd: Switch to bio_kmalloc()

2012-09-06 Thread Kent Overstreet
This is prep work for killing bi_destructor - previously, pktcdvd had its own pkt_bio_alloc which was basically duplication bio_kmalloc(), necessitating its own bi_destructor implementation. v5: Un-reorder some functions, to make the patch easier to review Signed-off-by: Kent Overstreet koverstr

[PATCH v10 2/8] block: Ues bi_pool for bio_integrity_alloc()

2012-09-06 Thread Kent Overstreet
Now that bios keep track of where they were allocated from, bio_integrity_alloc_bioset() becomes redundant. Remove bio_integrity_alloc_bioset() and drop bio_set argument from the related functions and make them use bio-bi_pool. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe

[PATCH v10 1/8] block: Generalized bio pool freeing

2012-09-06 Thread Kent Overstreet
destructors unnecessary, so they're then deleted. v6: Explain the temporary if statement in bio_put Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de CC: Alasdair Kergon a...@redhat.com CC: Nicholas Bellinger n...@linux-iscsi.org CC: Lars

Re: [PATCH] virtio-blk: Fix kconfig option

2012-09-06 Thread Kent Overstreet
On Fri, Sep 07, 2012 at 09:10:25AM +0930, Rusty Russell wrote: Kent Overstreet koverstr...@google.com writes: On Thu, Sep 06, 2012 at 12:49:56PM +0300, Michael S. Tsirkin wrote: On Thu, Sep 06, 2012 at 02:25:12AM -0700, Kent Overstreet wrote: Do you not understand the difference between

[PATCH v10 3/8] dm: Use bioset's front_pad for dm_rq_clone_bio_info

2012-09-07 Thread Kent Overstreet
, but due to the way io_pool is used and overloaded this looks not quite trivial so I'm leaving it for a later patch. v6: Fix comment on struct dm_rq_clone_bio_info, per Tejun Signed-off-by: Kent Overstreet koverstr...@google.com CC: Alasdair Kergon a...@redhat.com Acked-by: Tejun Heo t...@kernel.org

Re: [PATCH v10 0/8] Block cleanups

2012-09-07 Thread Kent Overstreet
On Thu, Sep 06, 2012 at 07:37:10PM -0600, Jens Axboe wrote: On 2012-09-06 17:48, Tejun Heo wrote: Hello, guys. (cc'ing Jens, Alasdair and Neil) On Thu, Sep 06, 2012 at 03:34:54PM -0700, Kent Overstreet wrote: Screwed up the bio_reset() patch in the last patch series when I went

[PATCH v10 5/8] pktcdvd: Switch to bio_kmalloc()

2012-09-07 Thread Kent Overstreet
This is prep work for killing bi_destructor - previously, pktcdvd had its own pkt_bio_alloc which was basically duplication bio_kmalloc(), necessitating its own bi_destructor implementation. v5: Un-reorder some functions, to make the patch easier to review Signed-off-by: Kent Overstreet koverstr

Re: [PATCH v10 4/8] block: Add bio_reset()

2012-09-07 Thread Kent Overstreet
On Thu, Sep 06, 2012 at 07:34:18PM -0600, Jens Axboe wrote: On 2012-09-06 16:34, Kent Overstreet wrote: Reusing bios is something that's been highly frowned upon in the past, but driver code keeps doing it anyways. If it's going to happen anyways, we should provide a generic method

[PATCH 0/2] Avoid deadlocks with bio allocation

2012-09-07 Thread Kent Overstreet
These patches were part of the block cleanups series I just sent out, but I split them off. Nothing's changed with them lately, the last thing I added was a bit of logic to the punt to rescue code to only punt bios that were allocated from the current bio_set. Kent Overstreet (2): block

[PATCH 2/2] block: Avoid deadlocks with bio allocation by stacking drivers

2012-09-07 Thread Kent Overstreet
to be submitted. Tested it by forcing the rescue codepath to be taken (by disabling the first GFP_NOWAIT) attempt, and then ran it with bcache (which does a lot of arbitrary bio splitting) and verified that the rescuer was being invoked. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax

[PATCH 1/2] block: Reorder struct bio_set

2012-09-07 Thread Kent Overstreet
This is prep work for the next patch, which embeds a struct bio_list in struct bio_set. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- include/linux/bio.h | 66 ++--- 1 file changed, 33 insertions(+), 33

Re: [PATCH v10 4/8] block: Add bio_reset()

2012-09-07 Thread Kent Overstreet
On Fri, Sep 07, 2012 at 04:06:45PM -0600, Jens Axboe wrote: On 2012-09-07 15:55, Jens Axboe wrote: On 2012-09-07 14:58, Kent Overstreet wrote: On Thu, Sep 06, 2012 at 07:34:18PM -0600, Jens Axboe wrote: On 2012-09-06 16:34, Kent Overstreet wrote: Reusing bios is something that's been

[PATCH 0/9] Prep work for immutable bio vecs

2012-09-07 Thread Kent Overstreet
, bi_idx and bi_bvec_done may both be nonzero. Again, just need to use generic accessors. Kent Overstreet (9): block: Convert integrity to bvec_alloc_bs(), and a bugfix block: Add bio_advance() block: Refactor blk_update_request() md: Convert md_trim_bio() to use bio_advance() block: Add

[PATCH 4/9] md: Convert md_trim_bio() to use bio_advance()

2012-09-07 Thread Kent Overstreet
Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/md.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 7a2b079..51ce48c 100644

[PATCH 9/9] block: Remove some unnecessary bi_vcnt usage

2012-09-07 Thread Kent Overstreet
More prep work for immutable bvecs/effecient bio splitting - usage of bi_vcnt has to be auditing, so getting rid of all the unnecessary usage makes that easier. Plus, bio_segments() is really what this code wanted, as it respects the current value of bi_idx. Signed-off-by: Kent Overstreet

[PATCH 8/9] block: Remove bi_idx references

2012-09-07 Thread Kent Overstreet
These were harmless but uneccessary,andt getting rid of them makes the code easier to audit since most of them need to be removed. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- drivers/block/floppy.c | 1 - drivers/md/dm-verity.c | 2 +- drivers/md

[PATCH 7/9] block: Don't use bi_idx in bio_split() or require it to be 0

2012-09-07 Thread Kent Overstreet
Prep work for immutable bio_vecs/efficient bio splitting: they require auditing and removing most uses of bi_idx. So here we convert bio_split() to respect the current value of bi_idx and use the bio_iovec() macro, instead of assuming bi_idx will be 0. Signed-off-by: Kent Overstreet koverstr

[PATCH 6/9] block: Use bio_sectors() more consistently

2012-09-07 Thread Kent Overstreet
Bunch of places in the code weren't using it where they could be - this'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx into a struct bvec_iter. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- drivers/block/aoe/aoeblk.c | 2

[PATCH 5/9] block: Add bio_end()

2012-09-07 Thread Kent Overstreet
Just a little convenience macro - main reason to add it now is preparing for immutable bio vecs, it'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx into a struct bvec_iter. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- block/blk

[PATCH 3/9] block: Refactor blk_update_request()

2012-09-07 Thread Kent Overstreet
Converts it to use bio_advance(), simplifying it quite a bit in the process. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- block/blk-core.c | 84 +++- 1 file changed, 16 insertions(+), 68 deletions

[PATCH 2/9] block: Add bio_advance()

2012-09-07 Thread Kent Overstreet
This is prep work for immutable bio vecs; we first want to centralize where bvecs are modified. Next two patches convert some existing code to use this function. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- fs/bio.c| 41

[PATCH 1/9] block: Convert integrity to bvec_alloc_bs(), and a bugfix

2012-09-07 Thread Kent Overstreet
for the pointer. Less code is always nice too, though. Also fix an amusing bug in bio_integrity_split() - struct bio_pair doesn't have the integrity bvecs after the bio_integrity_payloads, so there was a buffer overrun. The code was confusing pointers with arrays. Signed-off-by: Kent Overstreet koverstr

Re: [dm-devel] [PATCH v10 4/8] block: Add bio_reset()

2012-09-07 Thread Kent Overstreet
On Sat, Sep 08, 2012 at 12:14:33AM +0100, Alasdair G Kergon wrote: As I indicated already in this discussion, dm started to use merge_bvec_fn as a cheap way of avoiding splitting and this improved overall efficiency. Often it's better to pay the small price of calling that function to ensure

Re: [PATCH 2/2] block: Avoid deadlocks with bio allocation by stacking drivers

2012-09-09 Thread Kent Overstreet
On Sat, Sep 08, 2012 at 12:36:41PM -0700, Tejun Heo wrote: (Restoring cc list from the previous discussion. Please retain the cc list of the people who discussed in the previous postings.) On Fri, Sep 07, 2012 at 03:12:53PM -0700, Kent Overstreet wrote: But this is tricky and not a generic

Re: [PATCH 0/9] Prep work for immutable bio vecs

2012-09-09 Thread Kent Overstreet
On Sat, Sep 08, 2012 at 12:41:15PM -0700, Tejun Heo wrote: Hello, Kent. On Fri, Sep 07, 2012 at 03:59:11PM -0700, Kent Overstreet wrote: Random assortment of refactoring and trivial cleanups. Immutable bio vecs and efficient bio splitting require auditing and removing pretty much all

Re: [PATCH 2/2] block: Avoid deadlocks with bio allocation by stacking drivers

2012-09-10 Thread Kent Overstreet
On Mon, Sep 10, 2012 at 10:22:10AM -0700, Tejun Heo wrote: Hello, Kent. On Sun, Sep 09, 2012 at 05:28:10PM -0700, Kent Overstreet wrote: + while ((bio = bio_list_pop(current-bio_list))) + bio_list_add(bio-bi_pool == bs ? punt : nopunt, bio

Re: [PATCH 2/2] block: Avoid deadlocks with bio allocation by stacking drivers

2012-09-10 Thread Kent Overstreet
On Mon, Sep 10, 2012 at 01:40:10PM -0700, Tejun Heo wrote: Hello, Kent. On Mon, Sep 10, 2012 at 01:24:35PM -0700, Kent Overstreet wrote: And at that point, why duplicate that line of code? It doesn't matter that much, but IMO a goto retry better labels what's actually going on (it's

Re: [PATCH 2/2] block: Avoid deadlocks with bio allocation by stacking drivers

2012-09-10 Thread Kent Overstreet
On Mon, Sep 10, 2012 at 02:37:10PM -0700, Tejun Heo wrote: On Mon, Sep 10, 2012 at 02:33:49PM -0700, Kent Overstreet wrote: Simpler isn't really an objective thing though. To me the goto version is more obvious/idiomatic. Eh. I'll do it your way, but consider this a formal objection :p

Re: [dm-devel] [PATCH 2/2] block: Avoid deadlocks with bio allocation by stacking drivers

2012-09-10 Thread Kent Overstreet
On Mon, Sep 10, 2012 at 11:50:57PM +0100, Alasdair G Kergon wrote: On Mon, Sep 10, 2012 at 03:09:10PM -0700, Tejun Heo wrote: On Mon, Sep 10, 2012 at 02:56:33PM -0700, Kent Overstreet wrote: commit df7e63cbffa3065fcc4ba2b9a93418d7c7312243 Author: Kent Overstreet koverstr...@google.com

Re: [dm-devel] [PATCH 2/2] block: Avoid deadlocks with bio allocation by stacking drivers

2012-09-10 Thread Kent Overstreet
On Mon, Sep 10, 2012 at 04:01:01PM -0700, Tejun Heo wrote: Hello, On Mon, Sep 10, 2012 at 3:50 PM, Alasdair G Kergon a...@redhat.com wrote: Note that this doesn't do anything for allocation from other mempools. Note that dm has several cases of this, so this patch should not be

Re: [Drbd-dev] FLUSH/FUA documentation code discrepancy

2012-09-10 Thread Kent Overstreet
On Mon, Sep 10, 2012 at 04:06:54PM -0700, Tejun Heo wrote: Hello, again. cc'ing Kent and Vivek. The original thread is at http://thread.gmane.org/gmane.linux.network.drbd.devel/2130 On Mon, Sep 10, 2012 at 03:54:42PM -0700, Tejun Heo wrote: We can possibly work around that by

Re: [Drbd-dev] FLUSH/FUA documentation code discrepancy

2012-09-10 Thread Kent Overstreet
cc'ing Neil On Mon, Sep 10, 2012 at 04:06:54PM -0700, Tejun Heo wrote: Hello, again. cc'ing Kent and Vivek. The original thread is at http://thread.gmane.org/gmane.linux.network.drbd.devel/2130 On Mon, Sep 10, 2012 at 03:54:42PM -0700, Tejun Heo wrote: We can possibly work around

[PATCH v2 00/26] Prep work for immutable bio vecs

2012-09-10 Thread Kent Overstreet
, bi_idx and bi_bvec_done may both be nonzero. Again, just need to use generic accessors. v2: Patch series now has all the prep work to be done before abstracting out the bio iterator, I think. Kent Overstreet (26): block: Convert integrity to bvec_alloc_bs(), and a bugfix block: Add bio_advance

[PATCH v2 03/26] block: Refactor blk_update_request()

2012-09-10 Thread Kent Overstreet
Converts it to use bio_advance(), simplifying it quite a bit in the process. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- block/blk-core.c | 84 +++- 1 file changed, 16 insertions(+), 68 deletions

[PATCH v2 07/26] block: Don't use bi_idx in bio_split() or require it to be 0

2012-09-10 Thread Kent Overstreet
Prep work for immutable bio_vecs/efficient bio splitting: they require auditing and removing most uses of bi_idx. So here we convert bio_split() to respect the current value of bi_idx and use the bio_iovec() macro, instead of assuming bi_idx will be 0. Signed-off-by: Kent Overstreet koverstr

[PATCH v2 06/26] block: Use bio_sectors() more consistently

2012-09-10 Thread Kent Overstreet
Bunch of places in the code weren't using it where they could be - this'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx into a struct bvec_iter. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- drivers/block/aoe/aoeblk.c | 2

[PATCH v2 15/26] block: Add bio_copy_data()

2012-09-10 Thread Kent Overstreet
This gets open coded quite a bit and it's tricky to get right, so make a generic version and convert some existing users over to it instead. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- fs/bio.c| 70

[PATCH v2 16/26] pktcdvd: use bio_copy_data()

2012-09-10 Thread Kent Overstreet
Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Jiri Kosina jkos...@suse.cz --- drivers/block/pktcdvd.c | 79 - 1 file changed, 12 insertions(+), 67 deletions(-) diff --git a/drivers/block/pktcdvd.c b

[PATCH v2 26/26] block: Add BIO_SUBMITTED flag, kill BIO_CLONED

2012-09-10 Thread Kent Overstreet
for the new flag. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- block/blk-core.c | 2 ++ drivers/md/dm.c | 1 - fs/bio-integrity.c| 1 - fs/bio.c | 8 +--- include/linux/blk_types.h | 2 +- 5 files changed, 8

[PATCH v2 25/26] bio-integrity: Add explicit field for owner of bip_buf

2012-09-10 Thread Kent Overstreet
This was the only real user of BIO_CLONED, which didn't have very clear semantics. Convert to its own flag so we can get rid of BIO_CLONED. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: Martin K. Petersen martin.peter...@oracle.com --- fs/bio

[PATCH v2 24/26] block: Add an explicit bio flag for bios that own their bvec

2012-09-10 Thread Kent Overstreet
This is for the new bio splitting code. When we split a bio, if the split occured on a bvec boundry we reuse the bvec for the new bio. But that means bio_free() can't free it, hence the explicit flag. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk Acked

[PATCH v2 23/26] raid1: use bio_alloc_pages()

2012-09-10 Thread Kent Overstreet
Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid1.c | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index d30b4cb..18b743a 100644

[PATCH v2 22/26] block: Add bio_alloc_pages()

2012-09-10 Thread Kent Overstreet
More utility code to replace stuff that's getting open coded. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- fs/bio.c| 28 include/linux/bio.h | 1 + 2 files changed, 29 insertions(+) diff --git a/fs/bio.c b/fs

[PATCH v2 20/26] block: Add bio_for_each_segment_all()

2012-09-10 Thread Kent Overstreet
. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- drivers/md/raid1.c | 2 +- fs/bio.c| 12 ++-- fs/exofs/ore.c | 2 +- fs/exofs/ore_raid.c | 2 +- include/linux/bio.h | 16 +--- mm/bounce.c | 2 +- 6 files

[PATCH v2 21/26] block: Convert some code to bio_for_each_segment_all()

2012-09-10 Thread Kent Overstreet
A few places in the code were either open coding or using the wrong version - fix. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/dm-crypt.c | 3 +-- drivers/md/raid1.c| 10 +++--- fs/bio.c

[PATCH v2 19/26] bounce: Refactor __blk_queue_bounce to not use bi_io_vec

2012-09-10 Thread Kent Overstreet
the bounce code doesn't own that bio the __ version wasn't correct. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- mm/bounce.c | 73 - 1 file changed, 19 insertions(+), 54 deletions(-) diff

[PATCH v2 18/26] raid1: use bio_copy_data()

2012-09-10 Thread Kent Overstreet
This doesn't really delete any code _yet_, but once immutable bvecs are done we can just delete the rest of the code in that loop. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid1.c | 5 ++--- 1 file changed, 2

[PATCH v2 17/26] pktcdvd: Use bio_reset() in disabled code to kill bi_idx usage

2012-09-10 Thread Kent Overstreet
In the short term this'll help with code auditing, and if this code ever gets used now it's converted :) Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jiri Kosina jkos...@suse.cz --- drivers/block/pktcdvd.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff

[PATCH v2 14/26] raid1: Refactor narrow_write_error() to not use bi_idx

2012-09-10 Thread Kent Overstreet
More bi_idx removal. This code was just open coding bio_clone(). This could probably be further improved by using bio_advance() instead of skipping over null pages, but that'd be a larger rework. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne

[PATCH v2 13/26] raid5: use bio_reset()

2012-09-10 Thread Kent Overstreet
Had to shuffle the code around a bit (where bi_rw and bi_end_io were set), but shouldn't really be anything tricky here Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid5.c | 28 ++-- 1

[PATCH v2 12/26] raid1: use bio_reset()

2012-09-10 Thread Kent Overstreet
I couldn't figure out what sbio-bi_end_io in process_checks() was supposed to be, so I took the easy way out. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid1.c | 22 +- 1 file changed, 5

[PATCH v2 11/26] raid10: Use bio_reset()

2012-09-10 Thread Kent Overstreet
More prep work for immutable bio vecs, mainly getting rid of references to bi_idx. bio_reset was being open coded in a few places. The one in sync_request was a bit nontrivial to convert, so could use some extra eyeballs. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax

[PATCH v2 10/26] block: Add submit_bio_wait(), remove from md

2012-09-10 Thread Kent Overstreet
Random cleanup - this code was duplicated and it's not really specific to md. Also added the ability to return the actual error code. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/raid1.c | 19

[PATCH v2 09/26] block: Remove some unnecessary bi_vcnt usage

2012-09-10 Thread Kent Overstreet
More prep work for immutable bvecs/effecient bio splitting - usage of bi_vcnt has to be auditing, so getting rid of all the unnecessary usage makes that easier. Plus, bio_segments() is really what this code wanted, as it respects the current value of bi_idx. Signed-off-by: Kent Overstreet

[PATCH v2 08/26] block: Remove bi_idx references

2012-09-10 Thread Kent Overstreet
These were harmless but uneccessary,andt getting rid of them makes the code easier to audit since most of them need to be removed. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- drivers/block/floppy.c | 1 - drivers/md/dm-verity.c | 2 +- drivers/md

[PATCH v2 05/26] block: Add bio_end()

2012-09-10 Thread Kent Overstreet
Just a little convenience macro - main reason to add it now is preparing for immutable bio vecs, it'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx into a struct bvec_iter. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- block/blk

[PATCH v2 04/26] md: Convert md_trim_bio() to use bio_advance()

2012-09-10 Thread Kent Overstreet
Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de --- drivers/md/md.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 7a2b079..51ce48c 100644

[PATCH v2 02/26] block: Add bio_advance()

2012-09-10 Thread Kent Overstreet
This is prep work for immutable bio vecs; we first want to centralize where bvecs are modified. Next two patches convert some existing code to use this function. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk --- fs/bio.c| 41

[PATCH v2 01/26] block: Convert integrity to bvec_alloc_bs(), and a bugfix

2012-09-10 Thread Kent Overstreet
for the pointer. Less code is always nice too, though. Also fix an amusing bug in bio_integrity_split() - struct bio_pair doesn't have the integrity bvecs after the bio_integrity_payloads, so there was a buffer overrun. The code was confusing pointers with arrays. Signed-off-by: Kent Overstreet koverstr

Re: [dm-devel] [PATCH v10 8/8] block: Add bio_clone_bioset(), bio_clone_kmalloc()

2012-09-17 Thread Kent Overstreet
On Fri, Sep 14, 2012 at 10:50:59PM +0100, Alasdair G Kergon wrote: On Thu, Sep 06, 2012 at 03:35:02PM -0700, Kent Overstreet wrote: Previously, there was bio_clone() but it only allocated from the fs bio set; as a result various users were open coding it and using __bio_clone(). Explain

Re: [dm-devel] [PATCH v10 1/8] block: Generalized bio pool freeing

2012-09-17 Thread Kent Overstreet
On Fri, Sep 14, 2012 at 07:28:28PM +0100, Alasdair G Kergon wrote: On Thu, Sep 06, 2012 at 03:34:55PM -0700, Kent Overstreet wrote: With the old code, when you allocate a bio from a bio pool you have to implement your own destructor that knows how to find the bio pool the bio was originally

Re: [dm-devel] [PATCH v2 01/26] block: Convert integrity to bvec_alloc_bs(), and a bugfix

2012-09-17 Thread Kent Overstreet
On Wed, Sep 12, 2012 at 03:39:18PM -0400, Martin K. Petersen wrote: Kent == Kent Overstreet koverstr...@google.com writes: Kent, Kent To fix the bug first, I'd have to reorder struct bio_pair and then Kent just delete two lines of code from bio_integrity_split(). But the Kent reordering

Re: [PATCH v2 25/26] bio-integrity: Add explicit field for owner of bip_buf

2012-09-17 Thread Kent Overstreet
On Wed, Sep 12, 2012 at 03:41:36PM -0400, Martin K. Petersen wrote: Kent == Kent Overstreet koverstr...@google.com writes: Kent This was the only real user of BIO_CLONED, which didn't have very Kent clear semantics. Convert to its own flag so we can get rid of Kent BIO_CLONED. I already

Re: [PATCH v2 02/26] block: Add bio_advance()

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 02:58:27PM -0700, Tejun Heo wrote: On Mon, Sep 10, 2012 at 05:22:13PM -0700, Kent Overstreet wrote: +/** + * bio_advance - increment/complete a bio by some number of bytes + * @bio: bio to advance + * @bytes: number of bytes to complete + * + * This updates

Re: [PATCH v2 03/26] block: Refactor blk_update_request()

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 04:20:00PM -0700, Tejun Heo wrote: Hello, On Mon, Sep 10, 2012 at 05:22:14PM -0700, Kent Overstreet wrote: static void req_bio_endio(struct request *rq, struct bio *bio, unsigned int nbytes, int error) { + /* +* XXX: bio_endio

Re: [PATCH v2 02/26] block: Add bio_advance()

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 04:25:06PM -0700, Tejun Heo wrote: Hello, On Thu, Sep 20, 2012 at 04:13:08PM -0700, Kent Overstreet wrote: I just cut and pasted that from blk_update_request(), which is what the next patch refactors... Yeah, well, that was written when we didn't have WARNs

Re: [PATCH v2 05/26] block: Add bio_end()

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 04:32:25PM -0700, Tejun Heo wrote: On Mon, Sep 10, 2012 at 05:22:16PM -0700, Kent Overstreet wrote: Just a little convenience macro - main reason to add it now is preparing for immutable bio vecs, it'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx

Re: [PATCH v2 06/26] block: Use bio_sectors() more consistently

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 04:36:18PM -0700, Tejun Heo wrote: On Mon, Sep 10, 2012 at 05:22:17PM -0700, Kent Overstreet wrote: diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index 321de7b..6e4420a 100644 --- a/drivers/block/aoe/aoeblk.c +++ b/drivers/block/aoe/aoeblk.c

Re: [PATCH v2 03/26] block: Refactor blk_update_request()

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 04:41:33PM -0700, Tejun Heo wrote: Hey, On Thu, Sep 20, 2012 at 04:36:32PM -0700, Kent Overstreet wrote: Other than that, I definitely like this. It would be nice to note that the custom partial bio advancing in blk_update_request() is replaced with multiple

Re: [PATCH v2 07/26] block: Don't use bi_idx in bio_split() or require it to be 0

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 04:45:44PM -0700, Tejun Heo wrote: On Mon, Sep 10, 2012 at 05:22:18PM -0700, Kent Overstreet wrote: Prep work for immutable bio_vecs/efficient bio splitting: they require auditing and removing most uses of bi_idx. So here we convert bio_split() to respect

Re: [PATCH v2 08/26] block: Remove bi_idx references

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 04:49:53PM -0700, Tejun Heo wrote: On Mon, Sep 10, 2012 at 05:22:19PM -0700, Kent Overstreet wrote: These were harmless but uneccessary,andt getting rid of them makes the code easier to audit since most of them need to be removed. I find the descriptions a bit too

Re: [PATCH v2 15/26] block: Add bio_copy_data()

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 05:06:32PM -0700, Tejun Heo wrote: Hello, On Mon, Sep 10, 2012 at 05:22:26PM -0700, Kent Overstreet wrote: +void bio_copy_data(struct bio *dst, struct bio *src) +{ ... + src_p = kmap_atomic(src_bv-bv_page); + dst_p = kmap_atomic(dst_bv

Re: [PATCH v2 10/26] block: Add submit_bio_wait(), remove from md

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 04:56:43PM -0700, Tejun Heo wrote: On Mon, Sep 10, 2012 at 05:22:21PM -0700, Kent Overstreet wrote: Random cleanup - this code was duplicated and it's not really specific to md. Also added the ability to return the actual error code. Signed-off-by: Kent

Re: [PATCH v2 15/26] block: Add bio_copy_data()

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 05:09:47PM -0700, Tejun Heo wrote: On Thu, Sep 20, 2012 at 05:06:32PM -0700, Tejun Heo wrote: Hello, On Mon, Sep 10, 2012 at 05:22:26PM -0700, Kent Overstreet wrote: +void bio_copy_data(struct bio *dst, struct bio *src) +{ ... + src_p

Re: [PATCH v2 19/26] bounce: Refactor __blk_queue_bounce to not use bi_io_vec

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 05:25:55PM -0700, Tejun Heo wrote: Hello, Kent. On Mon, Sep 10, 2012 at 05:22:30PM -0700, Kent Overstreet wrote: A bunch of what __blk_queue_bounce() was doing was problematic for the immutable bvec work; this cleans that up and the code is quite a bit smaller

Re: [PATCH v2 19/26] bounce: Refactor __blk_queue_bounce to not use bi_io_vec

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 05:27:06PM -0700, Tejun Heo wrote: On Mon, Sep 10, 2012 at 05:22:30PM -0700, Kent Overstreet wrote: A bunch of what __blk_queue_bounce() was doing was problematic for the immutable bvec work; this cleans that up and the code is quite a bit smaller, too

Re: [PATCH v2 21/26] block: Convert some code to bio_for_each_segment_all()

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 05:38:32PM -0700, Tejun Heo wrote: On Mon, Sep 10, 2012 at 05:22:32PM -0700, Kent Overstreet wrote: A few places in the code were either open coding or using the wrong version - fix. Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax

Re: [PATCH v2 22/26] block: Add bio_alloc_pages()

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 05:47:11PM -0700, Tejun Heo wrote: On Mon, Sep 10, 2012 at 05:22:33PM -0700, Kent Overstreet wrote: + bio_for_each_segment_all(bv, bio, i) { + bv-bv_page = alloc_page(gfp_mask); + if (!bv-bv_page) { + while (bv-- != bio

Re: [PATCH v2 23/26] raid1: use bio_alloc_pages()

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 05:48:27PM -0700, Tejun Heo wrote: On Mon, Sep 10, 2012 at 05:22:34PM -0700, Kent Overstreet wrote: Signed-off-by: Kent Overstreet koverstr...@google.com CC: Jens Axboe ax...@kernel.dk CC: NeilBrown ne...@suse.de I think it's better to merge this and the previous

Re: [PATCH v2 12/26] raid1: use bio_reset()

2012-09-11 Thread Kent Overstreet
On Tue, Sep 11, 2012 at 02:59:13PM +1000, NeilBrown wrote: On Mon, 10 Sep 2012 17:22:23 -0700 Kent Overstreet koverstr...@google.com wrote: I couldn't figure out what sbio-bi_end_io in process_checks() was supposed to be, so I took the easy way out. Almost. You save 'sbio-bi_end_io

Re: [PATCH v2 13/26] raid5: use bio_reset()

2012-09-11 Thread Kent Overstreet
On Tue, Sep 11, 2012 at 03:03:26PM +1000, NeilBrown wrote: On Mon, 10 Sep 2012 17:22:24 -0700 Kent Overstreet koverstr...@google.com wrote: Had to shuffle the code around a bit (where bi_rw and bi_end_io were set), but shouldn't really be anything tricky here Signed-off-by: Kent

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