From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: dm-devel@redhat.com, "Alasdair G. Kergon" <agk@redhat.com>,
Zdenek Kabelac <zkabelac@redhat.com>
Subject: Re: [PATCH 0/3] offload bios to a thread
Date: Wed, 6 Jul 2016 09:36:56 -0400 [thread overview]
Message-ID: <20160706133656.GA28547@redhat.com> (raw)
In-Reply-To: <alpine.LRH.2.02.1607041846020.16388@file01.intranet.prod.int.rdu2.redhat.com>
On Mon, Jul 04 2016 at 6:53pm -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:
> Hi
>
> This is the second version of patches that fix deadlocks by redirecting
> bios from current->bio_list to rescuer workqueues.
>
> I found out that the original patches caused deadlock with the loopback
> device. When the loopback device is used, both lower and upper filesystems
> use the same bio set - fs_bio_set. Consequently, bios submitted by both of
> them end up on the same rescuer workqueue. There is a deadlock possibility
> - if generic_make_request for the upper filesystem's bio blocks (because
> there are too many requests in flight on the loop device), it may stall
> processing some bios for the lower filesystem.
>
> Ideadlly, each filesystem should have its own bio set. But it doesn't. So
> I fix this problem by not offloading bios allocated from fs_bio_set.
I'd much preferred you just send an incremental fix that built on the
tree you know I started, here:
http://git.kernel.org/cgit/linux/kernel/git/snitzer/linux.git/log/?h=wip
I've now folded your fix into this tree.
But please don't ignore work you know that was done to further prepare
your patches for inclusion. It makes for tedious busy work on my end to
pull out the incremental fix, which is simply:
diff --git a/block/bio.c b/block/bio.c
index 7c49b91..80ebe88 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -357,7 +357,9 @@ static void bio_alloc_rescue(struct work_struct *work)
* to their rescue workqueue.
*
* If the bio doesn't have a bio_set, we leave it on queued_bios->bio_list.
- * However, stacking drivers should use bio_set, so this shouldn't be
+ * If the bio is allocated from fs_bio_set, we must leave it to avoid
+ * deadlock on loopback block device.
+ * But stacking drivers should use a bio_set, so this shouldn't be
* an issue.
*/
static void blk_timer_flush_bio_list(unsigned long data)
@@ -371,7 +373,7 @@ static void blk_timer_flush_bio_list(unsigned long data)
while ((bio = bio_list_pop(&list))) {
unsigned long flags;
struct bio_set *bs = bio->bi_pool;
- if (unlikely(!bs)) {
+ if (unlikely(!bs) || bs == fs_bio_set) {
bio_list_add(&queued_bios->bio_list, bio);
continue;
}
next prev parent reply other threads:[~2016-07-06 13:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-04 22:53 [PATCH 0/3] offload bios to a thread Mikulas Patocka
2016-07-04 22:56 ` [PATCH 1/3] block: flush queued bios when process blocks to avoid deadlock Mikulas Patocka
2016-07-04 22:58 ` [PATCH 2/3] block: prepare for timed bio offload Mikulas Patocka
2016-07-04 22:59 ` [PATCH 3/3] block: use timed offload Mikulas Patocka
2016-07-06 13:36 ` Mike Snitzer [this message]
2016-07-06 13:53 ` [PATCH 0/3] offload bios to a thread Mikulas Patocka
2016-07-06 13:55 ` Mike Snitzer
2016-07-06 15:23 ` Mikulas Patocka
-- strict thread matches above, loose matches on Subject: below --
2016-06-29 0:16 Mikulas Patocka
2016-06-30 19:40 ` Mike Snitzer
2016-06-30 19:40 ` Mike Snitzer
2016-06-30 23:15 ` Mike Snitzer
2016-06-30 23:15 ` Mike Snitzer
2016-07-04 8:09 ` Lars Ellenberg
2016-07-04 8:09 ` Lars Ellenberg
2016-07-04 22:27 ` Mikulas Patocka
2016-07-04 22:27 ` Mikulas Patocka
2016-07-04 22:45 ` Mikulas Patocka
2016-07-04 22:45 ` Mikulas Patocka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160706133656.GA28547@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=mpatocka@redhat.com \
--cc=zkabelac@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.