[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <adccaa99-ffbc-4fbf-9210-47932724c184@huaweicloud.com>
Date: Sat, 25 Oct 2025 14:32:45 +0800
From: Baokun Li <libaokun@...weicloud.com>
To: 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,
yi.zhang@...wei.com, 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 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?
--
With Best Regards,
Baokun Li
Powered by blists - more mailing lists