[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZXAgut2MTKw50OLI@infradead.org>
Date: Tue, 5 Dec 2023 23:20:26 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Yu Kuai <yukuai1@...weicloud.com>
Cc: Christoph Hellwig <hch@...radead.org>, axboe@...nel.dk,
roger.pau@...rix.com, colyli@...e.de, kent.overstreet@...il.com,
joern@...ybastard.org, miquel.raynal@...tlin.com, richard@....at,
vigneshr@...com, sth@...ux.ibm.com, hoeppner@...ux.ibm.com,
hca@...ux.ibm.com, gor@...ux.ibm.com, agordeev@...ux.ibm.com,
jejb@...ux.ibm.com, martin.petersen@...cle.com, clm@...com,
josef@...icpanda.com, dsterba@...e.com, nico@...xnic.net,
xiang@...nel.org, chao@...nel.org, tytso@....edu,
adilger.kernel@...ger.ca, agruenba@...hat.com, jack@...e.com,
konishi.ryusuke@...il.com, willy@...radead.org,
akpm@...ux-foundation.org, hare@...e.de, p.raghav@...sung.com,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
xen-devel@...ts.xenproject.org, linux-bcache@...r.kernel.org,
linux-mtd@...ts.infradead.org, linux-s390@...r.kernel.org,
linux-scsi@...r.kernel.org, linux-bcachefs@...r.kernel.org,
linux-btrfs@...r.kernel.org, linux-erofs@...ts.ozlabs.org,
linux-ext4@...r.kernel.org, gfs2@...ts.linux.dev,
linux-nilfs@...r.kernel.org, yi.zhang@...wei.com,
yangerkun@...wei.com, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH -next RFC 01/14] block: add some bdev apis
On Wed, Dec 06, 2023 at 02:50:56PM +0800, Yu Kuai wrote:
> I'm a litter confused, so there are 3 use cases:
> 1) use GFP_USER, default gfp from bdev_alloc.
> 2) use GFP_KERNEL
> 3) use GFP_NOFS
>
> I understand that you're suggesting memalloc_nofs_save() to distinguish
> 2 and 3, but how can I distinguish 1?
You shouldn't. Diverging from the default flags except for clearing
the FS or IO flags is simply a bug. Note that things like block2mtd
should probably also ensure a noio allocation if they aren't doing that
yet.
> > - use memalloc_nofs_save in extet instead of using
> > mapping_gfp_constraint to clear it from the mapping flags
> > - remove __ext4_sb_bread_gfp and just have buffer.c helper that does
> > the right thing (either by changing the calling conventions of an
> > existing one, or adding a new one).
>
> Thanks for the suggestions, but I'm not sure how to do this yet, I must
> read more ext4 code.
the nofs save part should be trivial. You can just skip the rest for
now as it's not needed for this patch series.
Powered by blists - more mailing lists