# Re: \[dm-devel\] \[PATCH v2 1/1\] block: fix blk\_queue\_split() resource exhaustion

- From: NeilBrown \<hidden\>
- Date: 2016-07-12 02:55:35 
- List: linux-block
- Page: https://ratatoskr.run/linux-block/2016/07/4792579
- Thread: https://ratatoskr.run/linux-block/2016/07/4791095/t.md

```text
On Tue, Jul 12 2016, Lars Ellenberg wrote:
....
>
> Instead, I suggest to distinguish between recursive calls to
> generic_make_request(), and pushing back the remainder part in
> blk_queue_split(), by pointing current->bio_lists to a
> 	struct recursion_to_iteration_bio_lists {
> 		struct bio_list recursion;
> 		struct bio_list queue;
> 	}
>
> By providing each q->make_request_fn() with an empty "recursion"
> bio_list, then merging any recursively submitted bios to the
> head of the "queue" list, we can make the recursion-to-iteration
> logic in generic_make_request() process deepest level bios first,
> and "sibling" bios of the same level in "natural" order.
>
> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
> Signed-off-by: Roland Kammerer <redacted>

Reviewed-by: NeilBrown <redacted>

Thanks again for doing this - I think this is a very significant
improvement and could allow other simplifications.

NeilBrown
```

## Attachments

- [signature.asc](https://ratatoskr.run/linux-block/2016/07/4792579/attachment/0) (application/pgp-signature, 818 bytes)
