Re: [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-10 Thread NeilBrown
On Fri, Mar 10 2017, Lars Ellenberg wrote: >> --- a/block/blk-core.c >> +++ b/block/blk-core.c >> @@ -1975,7 +1975,14 @@ generic_make_request_checks(struct bio *bio) >> */ >> blk_qc_t generic_make_request(struct bio *bio) >> { >> - struct bio_list bio_list_on_stack; >> + /* >> +

Re: [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-10 Thread Lars Ellenberg
On Fri, Mar 10, 2017 at 04:07:58PM +0100, Jack Wang wrote: > On 10.03.2017 15:55, Mikulas Patocka wrote: > > On Fri, 10 Mar 2017, Mike Snitzer wrote: > >> On Fri, Mar 10 2017 at 7:34am -0500, > >> Lars Ellenberg wrote: > >> > --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -19

Re: [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-10 Thread Mike Snitzer
On Fri, Mar 10 2017 at 10:07am -0500, Jack Wang wrote: > > > On 10.03.2017 15:55, Mikulas Patocka wrote: > > > > > > On Fri, 10 Mar 2017, Mike Snitzer wrote: > > > >> On Fri, Mar 10 2017 at 7:34am -0500, > >> Lars Ellenberg wrote: > >> > --- a/block/blk-core.c > +++ b/block/blk-c

Re: [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-10 Thread Jack Wang
On 10.03.2017 15:55, Mikulas Patocka wrote: > > > On Fri, 10 Mar 2017, Mike Snitzer wrote: > >> On Fri, Mar 10 2017 at 7:34am -0500, >> Lars Ellenberg wrote: >> --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1975,7 +1975,14 @@ generic_make_request_checks(struct bio *bio) >>

Re: [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-10 Thread Mikulas Patocka
On Fri, 10 Mar 2017, Mike Snitzer wrote: > On Fri, Mar 10 2017 at 7:34am -0500, > Lars Ellenberg wrote: > > > > --- a/block/blk-core.c > > > +++ b/block/blk-core.c > > > @@ -1975,7 +1975,14 @@ generic_make_request_checks(struct bio *bio) > > > */ > > > blk_qc_t generic_make_request(struct

Re: [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-10 Thread Mike Snitzer
On Fri, Mar 10 2017 at 7:34am -0500, Lars Ellenberg wrote: > > --- a/block/blk-core.c > > +++ b/block/blk-core.c > > @@ -1975,7 +1975,14 @@ generic_make_request_checks(struct bio *bio) > > */ > > blk_qc_t generic_make_request(struct bio *bio) > > { > > - struct bio_list bio_list_on_sta

Re: [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-10 Thread Lars Ellenberg
> --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -1975,7 +1975,14 @@ generic_make_request_checks(struct bio *bio) > */ > blk_qc_t generic_make_request(struct bio *bio) > { > - struct bio_list bio_list_on_stack; > + /* > +* bio_list_on_stack[0] contains bios submitted b

Re: [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-09 Thread NeilBrown
On Thu, Mar 09 2017, Jens Axboe wrote: > On 03/09/2017 09:32 PM, NeilBrown wrote: >> >> I started looking further at the improvements we can make once >> generic_make_request is fixed, and realised that I had missed an >> important detail in this patch. >> Several places test current->bio_list, a

Re: [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-09 Thread Jens Axboe
On 03/09/2017 09:38 PM, Jens Axboe wrote: > On 03/09/2017 09:32 PM, NeilBrown wrote: >> >> I started looking further at the improvements we can make once >> generic_make_request is fixed, and realised that I had missed an >> important detail in this patch. >> Several places test current->bio_list,

Re: [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-09 Thread Jens Axboe
On 03/09/2017 09:32 PM, NeilBrown wrote: > > I started looking further at the improvements we can make once > generic_make_request is fixed, and realised that I had missed an > important detail in this patch. > Several places test current->bio_list, and two actually edit the list. > With this chan

Re: [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-09 Thread NeilBrown
I started looking further at the improvements we can make once generic_make_request is fixed, and realised that I had missed an important detail in this patch. Several places test current->bio_list, and two actually edit the list. With this change, that cannot see the whole lists, so it could caus

[PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-07 Thread NeilBrown
To avoid recursion on the kernel stack when stacked block devices are in use, generic_make_request() will, when called recursively, queue new requests for later handling. They will be handled when the make_request_fn for the current bio completes. If any bios are submitted by a make_request_fn,