[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9e963efb-fe5b-477c-afaf-f0b0677648f8@huaweicloud.com>
Date: Sat, 25 Oct 2025 15:01:20 +0800
From: Zhang Yi <yi.zhang@...weicloud.com>
To: Baokun Li <libaokun@...weicloud.com>, Matthew Wilcox
<willy@...radead.org>, "Darrick J. Wong" <djwong@...nel.org>
Cc: linux-ext4@...r.kernel.org, tytso@....edu, adilger.kernel@...ger.ca,
jack@...e.cz, linux-kernel@...r.kernel.org, kernel@...kajraghav.com,
mcgrof@...nel.org, linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
yangerkun@...wei.com, chengzhihao1@...wei.com, libaokun1@...wei.com
Subject: Re: [PATCH 22/25] fs/buffer: prevent WARN_ON in
__alloc_pages_slowpath() when BS > PS
On 10/25/2025 2:32 PM, Baokun Li wrote:
> On 2025-10-25 12:45, Matthew Wilcox wrote:
>> On Sat, Oct 25, 2025 at 11:22:18AM +0800, libaokun@...weicloud.com wrote:
>>> + while (1) {
>>> + folio = __filemap_get_folio(mapping, index, fgp_flags,
>>> + gfp & ~__GFP_NOFAIL);
>>> + if (!IS_ERR(folio) || !(gfp & __GFP_NOFAIL))
>>> + return folio;
>>> +
>>> + if (PTR_ERR(folio) != -ENOMEM && PTR_ERR(folio) != -EAGAIN)
>>> + return folio;
>>> +
>>> + memalloc_retry_wait(gfp);
>>> + }
>> No, absolutely not. We're not having open-coded GFP_NOFAIL semantics.
>> The right way forward is for ext4 to use iomap, not for buffer heads
>> to support large block sizes.
>
> ext4 only calls getblk_unmovable or __getblk when reading critical
> metadata. Both of these functions set __GFP_NOFAIL to ensure that
> metadata reads do not fail due to memory pressure.
>
> Both functions eventually call grow_dev_folio(), which is why we
> handle the __GFP_NOFAIL logic there. xfs_buf_alloc_backing_mem()
> has similar logic, but XFS manages its own metadata, allowing it
> to use vmalloc for memory allocation.
>
> ext4 Direct I/O has already switched to iomap, and patches to
> support iomap for Buffered I/O are currently under iteration.
>
> But as far as I know, iomap does not support metadata, and XFS does not
> use iomap to read metadata either.
>
> Am I missing something here?
>
AFAIK, Unless ext4 also manages metadata on its own, like XFS does,
instead of using the bdev buffer head interface. However, this is
currently difficult to achieve.
Best Regards,
Yi.
Powered by blists - more mailing lists