Re: [PATCH 1/3] md: Use folio_alloc_buffers()
From: Zi Yan <ziy@nvidia.com>
Date: 2026-09-14 14:36:45
Also in:
linux-mm
On 14 Sep 2026, at 9:20, David Hildenbrand (Arm) wrote:
On 9/14/26 15:17, Matthew Wilcox wrote:quoted
On Mon, Sep 14, 2026 at 03:12:31PM +0200, David Hildenbrand (Arm) wrote:quoted
On 9/14/26 06:18, Matthew Wilcox (Oracle) wrote:quoted
Remove the last user of alloc_page_buffers(). This isn't _great_,You should tell us "why" this isn't great. Because we're allocating folios although these things are not actually folios? I can only speculate :)Well, we actually aren't allocating folios in md-bitmap: for ( ; pnum < num_pages; pnum++) { store->filemap[pnum] = alloc_page(GFP_KERNEL|__GFP_ZERO); and it's not clear to me that we should be allocating folios; they're internal memory to the md-bitmap code that are never mapped to userspace, nor enter the page cache. But they do have buffer heads attached to them.Confusing indeed.quoted
The md-bitmap code probably needs to be rewritten to not use buffer heads at all, but then I hear from some people that it's scheduled for deletion, so don't spend any time on it. But I can't find anything official about that anywhere.quoted
Code itself looks good.Thanks!I'd assume Zi will pick up your patches and can massage the patch description to summarize why folios are awkward here, but that cleaning this up is future work.
Will do the replacement. The new description: Remove the last user of alloc_page_buffers(). Use folio_alloc_buffers() instead, since alloc_page_buffers() is a wrap over it. Although the pages used in md-bitmap are not folios, as they are not mapped into userspace nor enter the page cache, but they still have buffer heads attached. Cleaning up the code to not use buffer heads is future work. Best Regards, Yan, Zi