From: Tejun Heo <tj@kernel.org>
To: Adam Manzanares <adam.manzanares@hgst.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org, linux-ide@vger.kernel.org
Subject: Re: [PATCH 1/3] block: Add iocontext priority to request
Date: Sun, 2 Oct 2016 10:53:21 +0200 [thread overview]
Message-ID: <20161002085321.GA13648@mtj.duckdns.org> (raw)
In-Reply-To: <20160930160216.GA13637@hgst.com>
Hello, Adam.
On Fri, Sep 30, 2016 at 09:02:17AM -0700, Adam Manzanares wrote:
> I'll start with the changes I made and work my way through a grep of
> ioprio. Please add or correct any of the assumptions I have made.
Well, it looks like you're the one who's most familiar with ioprio
handling at this point. :)
> In blk-core, the behavior before the patch is to get the ioprio for the request
> from the bio. The only references I found to bio_set_prio are in bcache. Both
> of these references are in low priority operations (gc, bg writeback) so the
> iopriority of the bio is set to IO_PRIOCLASS_IDLE in these cases.
>
> A kernel thread is used to submit these bios so the ioprio is going to come
> from the current running task if the iocontext exists. This could be a problem
> if we have set a task with high priority and some background work ends up
> getting generated in the bcache layer. I propose that we check if the
> iopriority of the bio is valid and if so, then we keep the priorirty from the
> bio.
I wonder whether the right thing to do is adding bio->bi_ioprio which
is initialized on bio submission and carried through req->ioprio.
> The second area that I see a potential problem is in the merging code code in
> blk-core when a bio is queued. If there is a request that is mergeable then
> the merge code takes the highest priority of the bio and the request. This
> could wipe out the values set by bio_set_prio. I think it would be
> best to set the request as non mergeable when we see that it is a high
> priority IO request.
The current behavior should be fine for most non-pathological cases
but I have no objection to not merging ios with differing priorities.
> The third area that is of interest is in the CFQ scheduler and the ioprio is
> only used in the case of async IO and I found that the priority is only
> obtained from the task and not from the request. This leads me to believe that
> the changes made in the blk-core to add the priority to the request will not
> impact the CFQ scheduler.
>
> The fourth area that might be concerning is the drivers. virtio_block copies
> the request priority into a virtual block request. I am assuming that this
> eventually makes it to another device driver so we don't need to worry about
> this. null block device driver also uses the ioprio, but this is also not a
> concern. lightnvm also sets the ioprio to build a request that is passed onto
> another driver. The last driver that uses the request ioprio is the fusion
> mptsas driver and I don't understand how it is using the ioprio. From what I
> can tell it is taking a request of IOPRIO_CLASS_NONE with data of 0x7 and
> calling this high priority IO. This could be impacted by the code I have
> proposed, but I believe the authors intended to treat this particular ioprio
> value as high priority. The driver will pass the request to the device
> with high priority if the appropriate ioprio values is seen on the request.
>
> The fifth area that I noticed may be impacted is file systems. btrfs uses low
> priority IO for read ahead. Ext4 uses ioprio for journaling. Both of these
> issues are not a problem because the ioprio is set on the task and not on a
> bio.
Yeah, looks good to me. Care to include a brief summary of expected
(non)impacts in the patch description?
Thanks.
--
tejun
next prev parent reply other threads:[~2016-10-02 8:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-27 18:14 [PATCH 0/3] Enabling ATA Command Priorities Adam Manzanares
2016-09-27 18:14 ` [PATCH 1/3] block: Add iocontext priority to request Adam Manzanares
2016-09-29 8:40 ` Tejun Heo
2016-09-30 16:02 ` Adam Manzanares
2016-10-02 8:53 ` Tejun Heo [this message]
2016-10-04 15:49 ` Adam Manzanares
2016-10-04 20:52 ` Tejun Heo
2016-09-27 18:14 ` [PATCH 2/3] ata: Enabling ATA Command Priorities Adam Manzanares
2016-09-29 8:45 ` Tejun Heo
2016-09-30 16:04 ` Adam Manzanares
2016-09-27 18:14 ` [PATCH 3/3] ata: ATA Command Priority Disabled By Default Adam Manzanares
2016-09-28 2:06 ` [PATCH 0/3] Enabling ATA Command Priorities Christoph Hellwig
2016-09-28 3:43 ` Adam Manzanares
2016-09-29 8:48 ` tj
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=20161002085321.GA13648@mtj.duckdns.org \
--to=tj@kernel.org \
--cc=adam.manzanares@hgst.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-ide@vger.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).