From: Kanchan Joshi <joshi.k@samsung.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Keith Busch <kbusch@meta.com>,
linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
io-uring@vger.kernel.org, axboe@kernel.dk, hch@lst.de,
martin.petersen@oracle.com
Subject: Re: [PATCHv2 1/4] block: bio-integrity: directly map user buffers
Date: Tue, 7 Nov 2023 15:55:14 +0530 [thread overview]
Message-ID: <1067f03f-e89b-4fc8-58bb-0b83b6c5c91d@samsung.com> (raw)
In-Reply-To: <ZUkAH258Ts0caQ5W@kbusch-mbp.dhcp.thefacebook.com>
On 11/6/2023 8:32 PM, Keith Busch wrote:
> On Mon, Nov 06, 2023 at 11:18:03AM +0530, Kanchan Joshi wrote:
>> On 10/27/2023 11:49 PM, Keith Busch wrote:
>>> + for (i = 0; i < nr_vecs; i = j) {
>>> + size_t size = min_t(size_t, bytes, PAGE_SIZE - offs);
>>> + struct folio *folio = page_folio(pages[i]);
>>> +
>>> + bytes -= size;
>>> + for (j = i + 1; j < nr_vecs; j++) {
>>> + size_t next = min_t(size_t, PAGE_SIZE, bytes);
>>> +
>>> + if (page_folio(pages[j]) != folio ||
>>> + pages[j] != pages[j - 1] + 1)
>>> + break;
>>> + unpin_user_page(pages[j]);
>>
>> Is this unpin correct here?
>
> Should be. The pages are bound to the folio, so this doesn't really
> unpin the user page. It just drops a reference, and the folio holds the
> final reference to the contiguous pages, which is released on
> completion.
But the completion is still going to see multiple pages and not one
(folio). The bip_for_each_vec loop is going to drop the reference again.
I suspect it is not folio-aware.
next prev parent reply other threads:[~2023-11-07 10:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-27 18:19 [PATCHv2 0/4] block integrity: directly map user space addresses Keith Busch
2023-10-27 18:19 ` [PATCHv2 1/4] block: bio-integrity: directly map user buffers Keith Busch
2023-10-30 14:40 ` Pankaj Raghav
2023-10-30 14:54 ` Keith Busch
2023-10-30 15:27 ` kernel test robot
2023-10-30 21:02 ` Kanchan Joshi
2023-10-30 21:25 ` Keith Busch
2023-10-31 0:13 ` kernel test robot
2023-10-31 2:46 ` kernel test robot
2023-11-06 5:48 ` Kanchan Joshi
2023-11-06 15:02 ` Keith Busch
2023-11-07 10:25 ` Kanchan Joshi [this message]
2023-11-07 15:08 ` Keith Busch
2023-11-08 12:15 ` Kanchan Joshi
2023-11-08 17:19 ` Keith Busch
2023-10-27 18:19 ` [PATCHv2 2/4] nvme: use bio_integrity_map_user Keith Busch
2023-10-27 18:19 ` [PATCHv2 3/4] iouring: remove IORING_URING_CMD_POLLED Keith Busch
2023-10-27 18:19 ` [PATCHv2 4/4] io_uring: remove uring_cmd cookie Keith Busch
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=1067f03f-e89b-4fc8-58bb-0b83b6c5c91d@samsung.com \
--to=joshi.k@samsung.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=io-uring@vger.kernel.org \
--cc=kbusch@kernel.org \
--cc=kbusch@meta.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--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.