From: Jeff Moyer <jmoyer@redhat.com>
To: Adam Manzanares <adam.manzanares@hgst.com>
Cc: axboe@kernel.dk, tj@kernel.org, linux-block@vger.kernel.org,
linux-ide@vger.kernel.org
Subject: Re: [PATCH v2 2/2] block: Add iocontext priority to request
Date: Thu, 06 Oct 2016 15:46:00 -0400 [thread overview]
Message-ID: <x49d1jdi7lz.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <1475694007-11999-3-git-send-email-adam.manzanares@hgst.com> (Adam Manzanares's message of "Wed, 5 Oct 2016 12:00:07 -0700")
Hi, Adam,
Adam Manzanares <adam.manzanares@hgst.com> writes:
> Patch adds an association between iocontext ioprio and the ioprio of
> a request. This feature is only enabled if a queue flag is set to
> indicate that requests should have ioprio associated with them. The
> queue flag is exposed as the req_prio queue sysfs entry.
>
> Signed-off-by: Adam Mananzanares <adam.manzanares@hgst.com>
I like the idea of the patch, but I have a few comments.
First, don't add a tunable, there's no need for it. (And in the future,
if you do add tunables, document them.) That should make your patch
much smaller.
> @@ -1648,6 +1649,7 @@ out:
>
> void init_request_from_bio(struct request *req, struct bio *bio)
> {
> + struct io_context *ioc = rq_ioc(bio);
That can return NULL, and you blindly dereference it later.
> @@ -1656,7 +1658,11 @@ void init_request_from_bio(struct request *req, struct bio *bio)
>
> req->errors = 0;
> req->__sector = bio->bi_iter.bi_sector;
> - req->ioprio = bio_prio(bio);
> + if (blk_queue_req_prio(req->q))
> + req->ioprio = ioprio_best(bio_prio(bio), ioc->ioprio);
> + else
> + req->ioprio = bio_prio(bio);
> +
If the bio actually has an ioprio (only happens for bcache at this
point), you should use it. Something like this:
req->ioprio = bio_prio(bio);
if (!req->ioprio && ioc)
req->ioprio = ioc->ioprio;
Finally, please re-order your series as Hannes suggested.
Thanks!
Jeff
next prev parent reply other threads:[~2016-10-06 19:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-05 19:00 [PATCH v2 0/2] Enabling ATA Command Priorities Adam Manzanares
2016-10-05 19:00 ` [PATCH v2 1/2] ata: " Adam Manzanares
2016-10-06 6:23 ` Hannes Reinecke
2016-10-05 19:00 ` [PATCH v2 2/2] block: Add iocontext priority to request Adam Manzanares
2016-10-06 6:24 ` Hannes Reinecke
2016-10-06 19:46 ` Jeff Moyer [this message]
2016-10-10 20:37 ` Adam Manzanares
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=x49d1jdi7lz.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=adam.manzanares@hgst.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=tj@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).