From: Matthew Wilcox <willy@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: akpm@linux-foundation.org, Hui Zhu <teawater@antgroup.com>,
linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 2/3] buffer: Hoist GFP flags from grow_dev_page() to __getblk_gfp()
Date: Thu, 14 Sep 2023 18:25:49 +0100 [thread overview]
Message-ID: <ZQNCHeUAtpP9EFNX@casper.infradead.org> (raw)
In-Reply-To: <20230914091625.hjbmlanqc6sxonwi@quack3>
On Thu, Sep 14, 2023 at 11:16:25AM +0200, Jan Kara wrote:
> On Fri 11-08-23 17:15:27, Matthew Wilcox (Oracle) wrote:
> > grow_dev_page() is only called by grow_buffers(). grow_buffers()
> > is only called by __getblk_slow() and __getblk_slow() is only called
> > from __getblk_gfp(), so it is safe to move the GFP flags setting
> > all the way up. With that done, add a new bdev_getblk() entry point
> > that leaves the GFP flags the way the caller specified them.
> >
> > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
>
> Can't we just finish this gfp parameter conversion for all the users?
> There are five __getblk_gfp() users, three in buffer_head.h directly
> generate gfp mask, two (__bread_gfp() and sb_getblk_gfp()) pass it from the
> caller. All three __bread_gfp() callers are in buffer_head.h and directly
> generate gfp mask. sb_getblk_gfp() has five callers, all in ext4 and easily
> convertable as well.
>
> This results not only in cleaner code but also just checking
> sb_getblk_gfp() callers shows how confused they currently are about the gfp
> argument (passing NOFS, NOFAIL and other pointless flags). Secondly, we can
> keep using sb_getblk_gfp() from the filesystems instead of having to decide
> between sb_getblk_gfp() and bdev_getblk().
I didn't do __bread_gfp() because it's basically an internal interface.
All users call sb_bread(), sb_bread_unmovable() or __bread().
It doesn't seem worth doing. Now, if we start to see people actually
using __bread_gfp() outside of those three interfaces, I'd agree we need
to make it use GFP flags properly.
BTW, Andrew has taken the bdev_getblk() series into the mm tree, so
testing that tree might be a good idea for the ext4 developers (and other
filesystems; an earlier revision of this patchset had a bug which would
have only affected nilfs2).
next prev parent reply other threads:[~2023-09-14 17:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 16:15 [PATCH 0/3] Add and use bdev_getblk() Matthew Wilcox (Oracle)
2023-08-11 16:15 ` [PATCH 1/3] buffer: Pass GFP flags to folio_alloc_buffers() Matthew Wilcox (Oracle)
2023-08-11 16:15 ` [PATCH 2/3] buffer: Hoist GFP flags from grow_dev_page() to __getblk_gfp() Matthew Wilcox (Oracle)
2023-09-14 9:16 ` Jan Kara
2023-09-14 17:25 ` Matthew Wilcox [this message]
2023-08-11 16:15 ` [PATCH 3/3] ext4: Use bdev_getblk() to avoid memory reclaim in readahead path Matthew Wilcox (Oracle)
2023-08-11 16:17 ` Matthew Wilcox
2023-08-11 19:23 ` [PATCH 4/3] buffer: Use bdev_getblk() in __breadahead() Matthew Wilcox
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=ZQNCHeUAtpP9EFNX@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=teawater@antgroup.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;
as well as URLs for NNTP newsgroup(s).