From: Jens Axboe <axboe@kernel.dk>
To: "Alexander V. Buev" <a.buev@yadro.com>,
linux-block@vger.kernel.org, io-uring@vger.kernel.org,
Christoph Hellwig <hch@lst.de>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Pavel Begunkov <asml.silence@gmail.com>,
Chaitanya Kulkarni <chaitanyak@nvidia.com>,
Mikhail Malygin <m.malygin@yadro.com>,
linux@yadro.com
Subject: Re: [PATCH v2 2/3] block: io_uring: add READV_PI/WRITEV_PI operations
Date: Thu, 10 Feb 2022 12:07:13 -0700 [thread overview]
Message-ID: <b8082a03-ab50-8a28-b6fd-1bf6985713ec@kernel.dk> (raw)
In-Reply-To: <20220210190311.driobrtfavnb7ha3@yadro.com>
On 2/10/22 12:03 PM, Alexander V. Buev wrote:
>> On 2/10/22 6:08 AM, Alexander V. Buev wrote:
>>> Added new READV_PI/WRITEV_PI operations to io_uring.
>>> Added new pi_addr & pi_len fields to SQE struct.
>>> Added new pi_iter field and IOCB_USE_PI flag to kiocb struct.
>>> Make corresponding corrections to io uring trace event.
>>>
>>> +struct io_rw_pi_state {
>>> + struct iov_iter iter;
>>> + struct iov_iter_state iter_state;
>>> + struct iovec fast_iov[UIO_FASTIOV_PI];
>>> +};
>>> +
>>> +struct io_rw_pi {
>>> + struct io_rw rw;
>>> + struct iovec *pi_iov;
>>> + u32 nr_pi_segs;
>>> + struct io_rw_pi_state *s;
>>> +};
>>
>> One immediate issue I see here is that io_rw_pi is big, and we try very
>> hard to keep the per-command payload to 64-bytes. This would be 88 bytes
>> by my count :-/
>>
>> Do you need everything from io_rw? If not, I'd just make io_rw_pi
>> contain the bits you need and see if you can squeeze it into the
>> existing cacheline.
>
> In short - Yes. Current patch code call existing io_read/io_write functions.
> This functions use io_rw struct information and process this data.
> I wanted to use existing functions but may be this is wrong way in this
> case.
>
> The second problem with request size is that the patch adds pi_iter
> pointer to kiocb struct. This also increase whole request union
> length.
>
> So I can see some (may be possible) solution for this:
>
> 1) do not store whole kiocb struct in request
> and write fully separated io_read/write_pi functions
>
> 2) make special CONFIG_XXX variable and simplify hide this code
> as default
Option 2 really sucks, because then obviously everyone wants their
feature enabled, and then we are back to square one. So never rely on a
config option, if it can be avoided.
I'd like to see what option 1 looks like, that sounds like a far better
solution.
--
Jens Axboe
next prev parent reply other threads:[~2022-02-10 19:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-10 13:08 [PATCH v2 0/3] implement direct IO with integrity Alexander V. Buev
2022-02-10 13:08 ` [PATCH v2 1/3] block: bio-integrity: add PI iovec to bio Alexander V. Buev
2022-02-10 17:49 ` Chaitanya Kulkarni
2022-02-10 13:08 ` [PATCH v2 2/3] block: io_uring: add READV_PI/WRITEV_PI operations Alexander V. Buev
2022-02-10 15:39 ` Jens Axboe
2022-02-10 19:03 ` Alexander V. Buev
2022-02-10 19:07 ` Jens Axboe [this message]
2022-02-11 9:39 ` Alexander V. Buev
2022-02-10 13:08 ` [PATCH v2 3/3] block: fops: handle IOCB_USE_PI in direct IO Alexander V. Buev
2022-02-10 17:53 ` Chaitanya Kulkarni
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=b8082a03-ab50-8a28-b6fd-1bf6985713ec@kernel.dk \
--to=axboe@kernel.dk \
--cc=a.buev@yadro.com \
--cc=asml.silence@gmail.com \
--cc=chaitanyak@nvidia.com \
--cc=hch@lst.de \
--cc=io-uring@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux@yadro.com \
--cc=m.malygin@yadro.com \
--cc=martin.petersen@oracle.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.