From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Daniel Stodden <daniel.stodden@citrix.com>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
Jake Wires <Jake.Wires@citrix.com>
Subject: [PATCH RFC] xen/blkfront: use tagged queuing for barriers
Date: Thu, 22 Jul 2010 14:20:31 -0700 [thread overview]
Message-ID: <4C48B61F.2030302@goop.org> (raw)
When barriers are supported, then use QUEUE_ORDERED_TAG to tell the block
subsystem that it doesn't need to do anything else with the barriers.
Previously we used ORDERED_DRAIN which caused the block subsystem to
drain all pending IO before submitting the barrier, which would be
very expensive.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 92091a7..b61a021 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -418,10 +418,20 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size)
static int xlvbd_barrier(struct blkfront_info *info)
{
int err;
+ unsigned ordered = QUEUE_ORDERED_NONE;
- err = blk_queue_ordered(info->rq,
- info->feature_barrier ? QUEUE_ORDERED_DRAIN : QUEUE_ORDERED_NONE,
- NULL);
+ /*
+ * If we don't have barrier support, then there's really no
+ * way to guarantee write ordering, so we really just have to
+ * send writes to the backend and hope for the best. If
+ * barriers are supported, we don't really know what the
+ * flushing semantics of the barrier are, so again, tag the
+ * requests in order and hope for the best.
+ */
+ if (info->feature_barrier)
+ ordered = QUEUE_ORDERED_TAG;
+
+ err = blk_queue_ordered(info->rq, ordered, NULL);
if (err)
return err;
@@ -508,8 +518,7 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity,
info->rq = gd->queue;
info->gd = gd;
- if (info->feature_barrier)
- xlvbd_barrier(info);
+ xlvbd_barrier(info);
if (vdisk_info & VDISK_READONLY)
set_disk_ro(gd, 1);
next reply other threads:[~2010-07-22 21:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-22 21:20 Jeremy Fitzhardinge [this message]
2010-07-28 11:06 ` [PATCH RFC] xen/blkfront: use tagged queuing for barriers Daniel Stodden
2010-07-28 18:03 ` Jeremy Fitzhardinge
2010-07-28 21:52 ` Daniel Stodden
2010-07-28 23:12 ` Jeremy Fitzhardinge
2010-07-29 19:31 ` Daniel Stodden
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=4C48B61F.2030302@goop.org \
--to=jeremy@goop.org \
--cc=Jake.Wires@citrix.com \
--cc=Xen-devel@lists.xensource.com \
--cc=daniel.stodden@citrix.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.