From: Matthew Wilcox <willy@infradead.org>
To: Keith Busch <kbusch@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
Andrew Morton <akpm@linux-foundation.org>,
"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
Hugh Dickins <hughd@google.com>,
linux-mm@kvack.org, linux-block@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] block: Remove special-casing of compound pages
Date: Thu, 7 Dec 2023 23:57:03 +0000 [thread overview]
Message-ID: <ZXJbz2F6xi/ZGnsP@casper.infradead.org> (raw)
In-Reply-To: <ZXJCxbAm1_V7lPnF@kbusch-mbp>
On Thu, Dec 07, 2023 at 03:10:13PM -0700, Keith Busch wrote:
> On Mon, Aug 14, 2023 at 03:41:00PM +0100, Matthew Wilcox (Oracle) wrote:
> > void __bio_release_pages(struct bio *bio, bool mark_dirty)
> > {
> > - struct bvec_iter_all iter_all;
> > - struct bio_vec *bvec;
> > + struct folio_iter fi;
> > +
> > + bio_for_each_folio_all(fi, bio) {
> > + struct page *page;
> > + size_t done = 0;
> >
> > - bio_for_each_segment_all(bvec, bio, iter_all) {
> > - if (mark_dirty && !PageCompound(bvec->bv_page))
> > - set_page_dirty_lock(bvec->bv_page);
> > - bio_release_page(bio, bvec->bv_page);
> > + if (mark_dirty) {
> > + folio_lock(fi.folio);
> > + folio_mark_dirty(fi.folio);
> > + folio_unlock(fi.folio);
> > + }
> > + page = folio_page(fi.folio, fi.offset / PAGE_SIZE);
> > + do {
> > + bio_release_page(bio, page++);
> > + done += PAGE_SIZE;
> > + } while (done < fi.length);
> > }
> > }
>
> Is it okay to release same-folio pages while creating the bio instead of
> releasing all the pages at the completion? If so, the completion could
> provide just the final bio_release_page() instead looping. I'm more
> confirming if that's an appropriate way to use folios here.
For this patch, I'm just replicating the existing behaviour. We can
probably do much better. Honestly, the whole thing is kind of grotesque
and needs to be reformed ... but I think that's part of the physr project.
prev parent reply other threads:[~2023-12-07 23:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-14 14:41 [PATCH] block: Remove special-casing of compound pages Matthew Wilcox (Oracle)
2023-08-14 14:48 ` Hannes Reinecke
2023-08-16 17:03 ` Fix rare user data corruption when using THP Matthew Wilcox
2023-08-16 20:27 ` [PATCH] block: Remove special-casing of compound pages Hugh Dickins
2023-09-15 14:21 ` Matthew Wilcox
2023-09-15 22:48 ` Hugh Dickins
2023-12-07 21:04 ` Jens Axboe
2024-02-29 18:25 ` Greg Edwards
2024-02-29 19:37 ` Matthew Wilcox
2024-02-29 20:05 ` Greg Edwards
2023-12-07 22:10 ` Keith Busch
2023-12-07 23:57 ` Matthew Wilcox [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=ZXJbz2F6xi/ZGnsP@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=hughd@google.com \
--cc=kbusch@kernel.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=stable@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).