Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-08 Thread Lars Ellenberg
On Fri, Jul 08, 2016 at 07:24:24PM +0600, Pavel Goran wrote: > Friday, July 8, 2016, 7:00:35 PM, you wrote: > > On Fri, Jul 08, 2016 at 07:39:36PM +1000, NeilBrown wrote: > >> I think we just might be in violent agreement. > > > I thought so, too :-) > > > Should I merge both patches, > > rename

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-08 Thread Lars Ellenberg
On Fri, Jul 08, 2016 at 07:39:36PM +1000, NeilBrown wrote: > >> To make the patch "perfect", and maybe even more elegant we could treat > >> ->remainder and ->recursion more alike. > >> i.e.: > >> - generic make request has a private "stack" of requests. > >> - before calling ->make_request_fn(

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-08 Thread Lars Ellenberg
On Fri, Jul 08, 2016 at 07:08:32PM +0800, Ming Lei wrote: > > So after processing a particular bio, we should then process all the > > 'child' bios - bios send to underlying devices. Then the 'sibling' > > bios, that were split off, and then any remaining parents and ancestors. > > IMHO, that is

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-08 Thread Ming Lei
On Fri, Jul 8, 2016 at 6:07 AM, NeilBrown wrote: > On Thu, Jul 07 2016, Lars Ellenberg wrote: > >> On Thu, Jul 07, 2016 at 03:35:48PM +1000, NeilBrown wrote: >>> On Wed, Jun 22 2016, Lars Ellenberg wrote: >>> >>> > For a long time, generic_make_request() converts recursion into >>> > iteration by

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-08 Thread NeilBrown
On Fri, Jul 08 2016, Lars Ellenberg wrote: > On Fri, Jul 08, 2016 at 08:07:52AM +1000, NeilBrown wrote: >> Before I introduced the recursion limiting, requests were handled as an >> in-order tree walk. The code I wrote tried to preserve that but didn't >> for several reasons. I think we need to

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-08 Thread Lars Ellenberg
On Fri, Jul 08, 2016 at 08:07:52AM +1000, NeilBrown wrote: > Before I introduced the recursion limiting, requests were handled as an > in-order tree walk. The code I wrote tried to preserve that but didn't > for several reasons. I think we need to restore the original in-order > walk because it m

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-07 Thread NeilBrown
On Thu, Jul 07 2016, Lars Ellenberg wrote: > On Thu, Jul 07, 2016 at 03:35:48PM +1000, NeilBrown wrote: >> On Wed, Jun 22 2016, Lars Ellenberg wrote: >> >> > For a long time, generic_make_request() converts recursion into >> > iteration by queuing recursive arguments on current->bio_list. >> > >>

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-07 Thread Ming Lei
On Thu, Jul 7, 2016 at 4:03 PM, Lars Ellenberg wrote: > On Wed, Jul 06, 2016 at 11:57:51PM +0800, Ming Lei wrote: >> > my suggestion >> > >> > generic_make_request(bio_orig) >> > NULLin-flight=0 >> > bio_origempty in-flight=0 >> >

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-07 Thread Lars Ellenberg
be since 2007 (my suggestion as is does not). > > Which may change performance metrics. > It may even improve some of them, > or maybe it does nothing, but we don't know. > > Thanks, > > Lars > >From 73254eae63786aca0af10e42e5b41465c90d8da8 Mon Sep 17 00:00:0

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-07 Thread Lars Ellenberg
On Wed, Jul 06, 2016 at 11:57:51PM +0800, Ming Lei wrote: > > my suggestion > > > > generic_make_request(bio_orig) > > NULLin-flight=0 > > bio_origempty in-flight=0 > > qA->make_request_fn(bio_orig) > > blk_queue_split() > > res

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-07 Thread Lars Ellenberg
On Thu, Jul 07, 2016 at 03:35:48PM +1000, NeilBrown wrote: > On Wed, Jun 22 2016, Lars Ellenberg wrote: > > > For a long time, generic_make_request() converts recursion into > > iteration by queuing recursive arguments on current->bio_list. > > > > This is convenient for stacking drivers, > > the

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-06 Thread NeilBrown
On Wed, Jun 22 2016, Lars Ellenberg wrote: > For a long time, generic_make_request() converts recursion into > iteration by queuing recursive arguments on current->bio_list. > > This is convenient for stacking drivers, > the top-most driver would take the originally submitted bio, > and re-submit

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-06 Thread Ming Lei
On Wed, Jul 6, 2016 at 8:38 PM, Lars Ellenberg wrote: > On Mon, Jul 04, 2016 at 06:47:29PM +0800, Ming Lei wrote: >> >> One clean solution may be to convert the loop of generic_make_request() >> >> into the following way: >> >> >> >> do { >> >> struct bio *splitted, *remainder = NULL; >> >>

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-06 Thread Lars Ellenberg
On Mon, Jul 04, 2016 at 06:47:29PM +0800, Ming Lei wrote: > >> One clean solution may be to convert the loop of generic_make_request() > >> into the following way: > >> > >> do { > >> struct bio *splitted, *remainder = NULL; > >> struct request_queue *q = bdev_get_queue(bio->bi_bdev); > >>

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-04 Thread Ming Lei
On Mon, Jul 4, 2016 at 4:20 PM, Lars Ellenberg wrote: > On Sat, Jul 02, 2016 at 06:28:29PM +0800, Ming Lei wrote: >> The idea looks good, but not sure it can cover all cases of >> dm over brbd or brbd over dm and maintaining two lists >> becomes too complicated. >> >> One clean solution may be to

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-04 Thread Lars Ellenberg
On Sat, Jul 02, 2016 at 06:28:29PM +0800, Ming Lei wrote: > The idea looks good, but not sure it can cover all cases of > dm over brbd or brbd over dm and maintaining two lists > becomes too complicated. > > One clean solution may be to convert the loop of generic_make_request() > into the followi

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-02 Thread Ming Lei
On Wed, Jun 22, 2016 at 4:22 PM, Lars Ellenberg wrote: > For a long time, generic_make_request() converts recursion into > iteration by queuing recursive arguments on current->bio_list. > > This is convenient for stacking drivers, > the top-most driver would take the originally submitted bio, > an

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-02 Thread Ming Lei
On Tue, Jun 28, 2016 at 4:45 PM, Lars Ellenberg wrote: > On Sat, Jun 25, 2016 at 05:30:29PM +0800, Ming Lei wrote: >> On Fri, Jun 24, 2016 at 10:27 PM, Lars Ellenberg >> wrote: >> > On Fri, Jun 24, 2016 at 07:36:57PM +0800, Ming Lei wrote: >> >> > >> >> > This is not a theoretical problem. >> >>

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-06-28 Thread Lars Ellenberg
On Sat, Jun 25, 2016 at 05:30:29PM +0800, Ming Lei wrote: > On Fri, Jun 24, 2016 at 10:27 PM, Lars Ellenberg > wrote: > > On Fri, Jun 24, 2016 at 07:36:57PM +0800, Ming Lei wrote: > >> > > >> > This is not a theoretical problem. > >> > At least int DRBD, and an unfortunately high IO concurrency wr

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-06-25 Thread Ming Lei
On Fri, Jun 24, 2016 at 10:27 PM, Lars Ellenberg wrote: > On Fri, Jun 24, 2016 at 07:36:57PM +0800, Ming Lei wrote: >> > >> > This is not a theoretical problem. >> > At least int DRBD, and an unfortunately high IO concurrency wrt. the >> > "max-buffers" setting, without this patch we have a reprod

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-06-24 Thread Lars Ellenberg
On Fri, Jun 24, 2016 at 07:36:57PM +0800, Ming Lei wrote: > > > > This is not a theoretical problem. > > At least int DRBD, and an unfortunately high IO concurrency wrt. the > > "max-buffers" setting, without this patch we have a reproducible deadlock. > > Is there any log about the deadlock? And

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-06-24 Thread Ming Lei
On Wed, Jun 22, 2016 at 4:22 PM, Lars Ellenberg wrote: > For a long time, generic_make_request() converts recursion into > iteration by queuing recursive arguments on current->bio_list. > > This is convenient for stacking drivers, > the top-most driver would take the originally submitted bio, > an

[RFC] block: fix blk_queue_split() resource exhaustion

2016-06-22 Thread Lars Ellenberg
For a long time, generic_make_request() converts recursion into iteration by queuing recursive arguments on current->bio_list. This is convenient for stacking drivers, the top-most driver would take the originally submitted bio, and re-submit a re-mapped version of it, or one or more clones, or on