From: David Vrabel <david.vrabel@citrix.com>
To: Arianna Avanzini <avanzini.arianna@gmail.com>,
<konrad.wilk@oracle.com>, <boris.ostrovsky@oracle.com>,
<xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>
Cc: <bob.liu@oracle.com>, <felipe.franciosi@citrix.com>, <axboe@fb.com>
Subject: Re: [PATCH RFC 1/4] xen, blkfront: add support for the multi-queue block layer API
Date: Fri, 22 Aug 2014 13:25:34 +0100 [thread overview]
Message-ID: <53F736BE.9010202@citrix.com> (raw)
In-Reply-To: <1408706404-6614-2-git-send-email-avanzini.arianna@gmail.com>
On 22/08/14 12:20, Arianna Avanzini wrote:
> This commit introduces support for the multi-queue block layer API.
> The changes are only structural, and force both the use of the
> multi-queue API and the use of a single I/O ring, by initializing
> statically the number of hardware queues to one.
[...]
> @@ -98,6 +99,8 @@ static unsigned int xen_blkif_max_segments = 32;
> module_param_named(max, xen_blkif_max_segments, int, S_IRUGO);
> MODULE_PARM_DESC(max, "Maximum amount of segments in indirect requests (default is 32)");
>
> +static unsigned int hardware_queues = 1;
> +
> #define BLK_RING_SIZE __CONST_RING_SIZE(blkif, PAGE_SIZE)
>
> /*
> @@ -134,6 +137,8 @@ struct blkfront_info
> unsigned int feature_persistent:1;
> unsigned int max_indirect_segments;
> int is_ready;
> + /* Block layer tags. */
> + struct blk_mq_tag_set tag_set;
> };
>
> static unsigned int nr_minors;
> @@ -385,6 +390,7 @@ static int blkif_ioctl(struct block_device *bdev, fmode_t mode,
> * and writes are handled as expected.
> *
> * @req: a request struct
> + * @ring_idx: index of the ring the request is to be inserted in
This comment addition doesn't seem to correspond with anything?
> */
> static int blkif_queue_request(struct request *req)
> {
> @@ -632,6 +638,61 @@ wait:
> flush_requests(info);
> }
>
> +static int blkfront_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req)
> +{
> + struct blkfront_info *info = req->rq_disk->private_data;
> +
> + pr_debug("Entered blkfront_queue_rq\n");
I don't think this debug is useful.
> + spin_lock_irq(&info->io_lock);
Is this lock necessary? Does the block layer serialise calls to the
queue_rq op?
> + if (RING_FULL(&info->ring))
> + goto wait;
> +
> + if ((req->cmd_type != REQ_TYPE_FS) ||
> + ((req->cmd_flags & (REQ_FLUSH | REQ_FUA)) &&
> + !info->flush_op)) {
> + req->errors = -EIO;
> + blk_mq_complete_request(req);
> + spin_unlock_irq(&info->io_lock);
> + return BLK_MQ_RQ_QUEUE_ERROR;
> + }
> +
> + pr_debug("blkfront_queue_req %p: cmd %p, sec %lx, ""(%u/%u) [%s]\n",
> + req, req->cmd, (unsigned long)blk_rq_pos(req),
> + blk_rq_cur_sectors(req), blk_rq_sectors(req),
> + rq_data_dir(req) ? "write" : "read");
The block layer already has extensive tracing for requests. Is this
debug useful?
> @@ -639,9 +700,29 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size,
> struct request_queue *rq;
> struct blkfront_info *info = gd->private_data;
>
> - rq = blk_init_queue(do_blkif_request, &info->io_lock);
> - if (rq == NULL)
> - return -1;
> + if (hardware_queues) {
hardware_queues is never 0. Is this if here and elsewhere necessary?
David
next prev parent reply other threads:[~2014-08-22 12:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 11:20 [PATCH RFC 0/4] Multi-queue support for xen-blkfront and xen-blkback Arianna Avanzini
2014-08-22 11:20 ` [PATCH RFC 1/4] xen, blkfront: add support for the multi-queue block layer API Arianna Avanzini
2014-08-22 12:25 ` David Vrabel [this message]
2014-08-22 15:03 ` Christoph Hellwig
2014-08-22 15:02 ` Christoph Hellwig
2014-09-11 23:54 ` Arianna Avanzini
2014-08-22 11:20 ` [PATCH RFC 2/4] xen, blkfront: factor out flush-related checks from do_blkif_request() Arianna Avanzini
2014-08-22 12:45 ` David Vrabel
2014-08-22 11:20 ` [PATCH RFC 3/4] xen, blkfront: introduce support for multiple hw queues Arianna Avanzini
2014-08-22 12:52 ` David Vrabel
2014-09-11 23:36 ` Arianna Avanzini
2014-09-12 10:50 ` David Vrabel
2014-08-22 11:20 ` [PATCH RFC 4/4] xen, blkback: add support for multiple block rings Arianna Avanzini
2014-08-22 13:15 ` David Vrabel
2014-09-11 23:45 ` Arianna Avanzini
2014-09-12 3:13 ` Bob Liu
2014-09-12 10:24 ` David Vrabel
2014-09-15 9:23 ` [Xen-devel] [PATCH RFC 0/4] Multi-queue support for xen-blkfront and xen-blkback Roger Pau Monné
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=53F736BE.9010202@citrix.com \
--to=david.vrabel@citrix.com \
--cc=avanzini.arianna@gmail.com \
--cc=axboe@fb.com \
--cc=bob.liu@oracle.com \
--cc=boris.ostrovsky@oracle.com \
--cc=felipe.franciosi@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xenproject.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).