[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160704082006.GN3239@soda.linbit>
Date: Mon, 4 Jul 2016 10:20:07 +0200
From: Lars Ellenberg <lars.ellenberg@...bit.com>
To: Ming Lei <ming.lei@...onical.com>
Cc: linux-block <linux-block@...r.kernel.org>,
Roland Kammerer <roland.kammerer@...bit.com>,
Jens Axboe <axboe@...nel.dk>, NeilBrown <neilb@...e.com>,
Kent Overstreet <kent.overstreet@...il.com>,
Shaohua Li <shli@...nel.org>, Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...hat.com>,
"open list:DEVICE-MAPPER (LVM)" <dm-devel@...hat.com>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Takashi Iwai <tiwai@...e.de>, Jiri Kosina <jkosina@...e.cz>,
Zheng Liu <gnehzuil.liu@...il.com>,
Keith Busch <keith.busch@...el.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"open list:BCACHE (BLOCK LAYER CACHE)" <linux-bcache@...r.kernel.org>,
"open list:SOFTWARE RAID (Multiple Disks) SUPPORT"
<linux-raid@...r.kernel.org>
Subject: Re: [RFC] block: fix blk_queue_split() resource exhaustion
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 following way:
>
> do {
> struct bio *splitted, *remainder = NULL;
> struct request_queue *q = bdev_get_queue(bio->bi_bdev);
>
> blk_queue_split(q, &bio, &remainder, q->bio_split);
>
> ret = q->make_request_fn(q, bio);
>
> if (remainder)
> bio_list_add(current->bio_list, remainder);
> bio = bio_list_pop(current->bio_list);
> } while (bio)
Not good enough.
Consider DRBD on device-mapper on device-mapper on scsi,
or insert multipath and / or md raid into the stack.
The iterative call to q->make_request_fn() in the second iteration
may queue bios after the remainder.
Goal was to first process all "deeper level" bios
before processing the remainder.
You can achieve this by doing last-in-first-out on bio_list,
or by using two lists, as I suggested in the original post.
Lars
Powered by blists - more mailing lists