From: NeilBrown <neilb@suse.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-raid@vger.kernel.org, Shaohua Li <shli@kernel.org>,
Shaohua Li <shli@fusionio.com>, NeilBrown <neilb@suse.de>
Subject: [PATCH 3/4] block: stack unplug
Date: Thu, 26 Jul 2012 12:58:30 +1000 [thread overview]
Message-ID: <20120726025830.32180.39904.stgit@notabene.brown> (raw)
In-Reply-To: <20120726025650.32180.65163.stgit@notabene.brown>
From: Shaohua Li <shli@kernel.org>
MD raid1 prepares to dispatch request in unplug callback. If make_request in
low level queue also uses unplug callback to dispatch request, the low level
queue's unplug callback will not be called. Recheck the callback list helps
this case.
Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
---
block/blk-core.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 7296d3d..bf38a5b 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2900,17 +2900,16 @@ static void flush_plug_callbacks(struct blk_plug *plug)
{
LIST_HEAD(callbacks);
- if (list_empty(&plug->cb_list))
- return;
-
- list_splice_init(&plug->cb_list, &callbacks);
+ while (!list_empty(&plug->cb_list)) {
+ list_splice_init(&plug->cb_list, &callbacks);
- while (!list_empty(&callbacks)) {
- struct blk_plug_cb *cb = list_first_entry(&callbacks,
+ while (!list_empty(&callbacks)) {
+ struct blk_plug_cb *cb = list_first_entry(&callbacks,
struct blk_plug_cb,
list);
- list_del(&cb->list);
- cb->callback(cb);
+ list_del(&cb->list);
+ cb->callback(cb);
+ }
}
}
next prev parent reply other threads:[~2012-07-26 2:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-26 2:58 [PATCH 0/4] Plugging changes for blk/md/umem NeilBrown
2012-07-26 2:58 ` [PATCH 2/4] blk: centralize non-request unplug handling NeilBrown
2012-07-26 2:58 ` [PATCH 4/4] blk: pass from_schedule to non-request unplug functions NeilBrown
2012-07-26 2:58 ` [PATCH 1/4] md: remove plug_cnt feature of plugging NeilBrown
2012-07-26 2:58 ` NeilBrown [this message]
2012-07-31 7:08 ` [PATCH 0/4] Plugging changes for blk/md/umem Jens Axboe
2012-07-31 7:25 ` NeilBrown
2012-07-31 7:33 ` Jens Axboe
2012-07-31 8:44 ` NeilBrown
2012-07-31 8:54 ` Jens Axboe
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=20120726025830.32180.39904.stgit@notabene.brown \
--to=neilb@suse.de \
--cc=axboe@kernel.dk \
--cc=linux-raid@vger.kernel.org \
--cc=shli@fusionio.com \
--cc=shli@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).