From: Adam Manzanares <Adam.Manzanares@wdc.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: "viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
"bcrl@kvack.org" <bcrl@kvack.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-aio@kvack.org" <linux-aio@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] fs: Add aio priority support for block_dev
Date: Wed, 2 May 2018 18:07:13 +0000 [thread overview]
Message-ID: <8fda5d5f-1f95-0f44-e194-cdf266dc1336@wdc.com> (raw)
In-Reply-To: <20180502173322.GB27997@infradead.org>
On 5/2/18 10:33 AM, Christoph Hellwig wrote:
>> --- a/fs/aio.c
>> +++ b/fs/aio.c
>> @@ -1603,6 +1603,15 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
>> goto out_put_req;
>> }
>>
>> + if (req->common.ki_flags & IOCB_IOPRIO)
>> + /*
>> + * The IOCB_IOPRIO flag is set when the user supplied iocb
>> + * aio_rw_flag field has the RWF_IOPRIO flag set. If so,
>> + * aio_reqprio is interpreted as a I/O scheduling class and
>> + * priority.
>> + */
>> + req->common.ki_ioprio = iocb->aio_reqprio;
>
> Do we need any validation of the field here?
With this patch the only consumer of the ki_ioprio field is a block
device, which will eventually hit blk_init_request_from_bio where a
validation of the ioprio is hit.
I was hoping to get a simple patch in for the block device case and then
go back and look at other consumers of the kiocb and add ioprio support.
At that point it may be worth it to pull a check into this code.
>
> The only other thing I am a bit worried about is bloating struct kiocb
> with a field for a relatively uncommon feature, but I can't really
> see any much better way to pass it.
>
I'll look more closely at reusing existing fields for the next patch
submission. I am hoping that the feature will be used more often given
that WRR for NVME should be coming soon.
Thanks,
Adam
prev parent reply other threads:[~2018-05-02 18:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-30 16:57 [PATCH 0/2] AIO add per-command iopriority adam.manzanares
2018-04-30 16:57 ` [PATCH 1/2] fs: add RWF_IOPRIO adam.manzanares
2018-05-02 17:32 ` Christoph Hellwig
2018-05-02 17:51 ` Adam Manzanares
2018-04-30 16:57 ` [PATCH 2/2] fs: Add aio priority support for block_dev adam.manzanares
2018-05-02 17:33 ` Christoph Hellwig
2018-05-02 18:07 ` Adam Manzanares [this message]
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=8fda5d5f-1f95-0f44-e194-cdf266dc1336@wdc.com \
--to=adam.manzanares@wdc.com \
--cc=bcrl@kvack.org \
--cc=hch@infradead.org \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®