From: Christoph Hellwig <hch@lst.de>
To: Chinmay Gameti <c.gameti@samsung.com>
Cc: axboe@kernel.dk, hch@lst.de, kbusch@kernel.org,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
joshi.k@samsung.com, anuj20.g@samsung.com, nj.shetty@samsung.com,
kundan.kumar@samsung.com, gost.dev@samsung.com
Subject: Re: [PATCH] block: add larger order folio instead of pages for passthrough I/O
Date: Thu, 14 Nov 2024 17:17:44 +0100 [thread overview]
Message-ID: <20241114161744.GA2078@lst.de> (raw)
In-Reply-To: <20241114135335.21327-1-c.gameti@samsung.com>
On Thu, Nov 14, 2024 at 07:23:35PM +0530, Chinmay Gameti wrote:
> +unsigned int get_contig_folio_len(unsigned int *num_pages,
> + struct page **pages, unsigned int i,
> + struct folio *folio, size_t left,
> + size_t offset)
Not a good name for a non-static function (not even for a stic
one to be honest).
> @@ -313,21 +314,35 @@ static int bio_map_user_iov(struct request *rq, struct iov_iter *iter,
> if (unlikely(offs & queue_dma_alignment(rq->q)))
> j = 0;
> else {
> - for (j = 0; j < npages; j++) {
> + for (j = 0; j < npages; j += num_pages) {
> struct page *page = pages[j];
> - unsigned int n = PAGE_SIZE - offs;
> + struct folio *folio = page_folio(page);
> bool same_page = false;
>
> - if (n > bytes)
> - n = bytes;
>
> - if (!bio_add_hw_page(rq->q, bio, page, n, offs,
> - max_sectors, &same_page))
> + folio_offset = ((size_t)folio_page_idx(folio,
> + page) << PAGE_SHIFT) + offs;
I'm not sure if Jens want to rush something like this in for 6.13, but if
we're aiming for the next merge window I actually have a 3/4 done series
that rips out bio_add_hw_page and all the passthrough special casing by
simply running the 'do we need to split the bio' helper on the free-form
bio and return an error if we do. That means all this code will go away,
and you'll automatically get all the work done for the normal path for
passthrough as well.
> diff --git a/include/linux/bio.h b/include/linux/bio.h
> index 60830a6a5939..1e5fbc875ecc 100644
> --- a/include/linux/bio.h
> +++ b/include/linux/bio.h
> @@ -422,6 +422,10 @@ void __bio_add_page(struct bio *bio, struct page *page,
> unsigned int len, unsigned int off);
> void bio_add_folio_nofail(struct bio *bio, struct folio *folio, size_t len,
> size_t off);
> +unsigned int get_contig_folio_len(unsigned int *num_pages,
> + struct page **pages, unsigned int i,
> + struct folio *folio, size_t left,
> + size_t offset);
And this really should bot be in a public header.
next prev parent reply other threads:[~2024-11-14 16:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20241114140134epcas5p3474e82266c4c117919a920d1dd4ed410@epcas5p3.samsung.com>
2024-11-14 13:53 ` [PATCH] block: add larger order folio instead of pages for passthrough I/O Chinmay Gameti
2024-11-14 16:17 ` Christoph Hellwig [this message]
2024-11-14 19:59 ` Jens Axboe
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=20241114161744.GA2078@lst.de \
--to=hch@lst.de \
--cc=anuj20.g@samsung.com \
--cc=axboe@kernel.dk \
--cc=c.gameti@samsung.com \
--cc=gost.dev@samsung.com \
--cc=joshi.k@samsung.com \
--cc=kbusch@kernel.org \
--cc=kundan.kumar@samsung.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nj.shetty@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox