From: Matthew Wilcox <willy@infradead.org>
To: Kundan Kumar <kundan.kumar@samsung.com>
Cc: axboe@kernel.dk, hch@lst.de, kbusch@kernel.org,
linux-block@vger.kernel.org, joshi.k@samsung.com,
mcgrof@kernel.org, anuj20.g@samsung.com, nj.shetty@samsung.com,
c.gameti@samsung.com, gost.dev@samsung.com
Subject: Re: [PATCH v4 2/2] block: unpin user pages belonging to a folio
Date: Wed, 5 Jun 2024 22:22:11 +0100 [thread overview]
Message-ID: <ZmDXAxGm01XayBSn@casper.infradead.org> (raw)
In-Reply-To: <20240605092455.20435-3-kundan.kumar@samsung.com>
On Wed, Jun 05, 2024 at 02:54:55PM +0530, Kundan Kumar wrote:
> - page = folio_page(fi.folio, fi.offset / PAGE_SIZE);
> - nr_pages = (fi.offset + fi.length - 1) / PAGE_SIZE -
> - fi.offset / PAGE_SIZE + 1;
> - do {
> - bio_release_page(bio, page++);
> - } while (--nr_pages != 0);
> + bio_release_page(bio, &fi.folio->page);
> }
Why can't we have ...
bio_release_folio(bio, fi.folio, nr_pages);
which is implemented as:
static inline void bio_release_page(struct bio *bio, struct folio *folio, unsigned long nr_pages)
{
if (bio_flagged(bio, BIO_PAGE_PINNED))
gup_put_folio(folio, nr_pages, FOLL_PIN);
}
Sure, we'd need to make gup_put_folio() unstatic, but this seems far
more sensible.
next prev parent reply other threads:[~2024-06-05 21:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20240605093220epcas5p18c9f9d8fe89f53f91f7c1c2464b07a65@epcas5p1.samsung.com>
2024-06-05 9:24 ` [PATCH v4 0/2] block: add larger order folio instead of pages Kundan Kumar
2024-06-05 9:24 ` [PATCH v4 1/2] block: add folio awareness instead of looping through pages Kundan Kumar
2024-06-05 18:45 ` Matthew Wilcox
2024-06-06 4:54 ` Christoph Hellwig
2024-06-05 21:23 ` Matthew Wilcox
2024-06-06 4:56 ` Christoph Hellwig
2024-06-10 9:26 ` Kundan Kumar
2024-06-11 13:50 ` kernel test robot
2024-06-11 13:50 ` [LTP] " kernel test robot
2024-06-05 9:24 ` [PATCH v4 2/2] block: unpin user pages belonging to a folio Kundan Kumar
2024-06-05 21:22 ` Matthew Wilcox [this message]
2024-06-06 4:58 ` Christoph Hellwig
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=ZmDXAxGm01XayBSn@casper.infradead.org \
--to=willy@infradead.org \
--cc=anuj20.g@samsung.com \
--cc=axboe@kernel.dk \
--cc=c.gameti@samsung.com \
--cc=gost.dev@samsung.com \
--cc=hch@lst.de \
--cc=joshi.k@samsung.com \
--cc=kbusch@kernel.org \
--cc=kundan.kumar@samsung.com \
--cc=linux-block@vger.kernel.org \
--cc=mcgrof@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 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.