lkml.org 
[lkml]   [2024]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] mm/cma: convert cma_alloc() to return folio
From


On 2/27/24 11:00 AM, Matthew Wilcox wrote:
> On Tue, Feb 27, 2024 at 10:13:38AM -0800, Jianfeng Wang wrote:
>> Change cma_alloc() to return struct folio. This further increases the
>> usage of folios in mm/hugetlb.
>
> I love the idea, but I don't think this works. The memory returned
> from cma_alloc() isn't set up to be a folio, is it? That is, it
> doesn't have compound_head initialised so that page_folio() on
> consecutive pages will return the same pointer.
>

Thanks for review.
cma_alloc() returns an array of order-0 pages. So, this commit makes
cma_alloc() return an array of folios (each an order-0 page) rather
than a compound page. Functions that use cma_alloc() do not expect
a compound page as well.

> Or have I misunderstood?

\
 
 \ /
  Last update: 2024-05-27 15:25    [W:0.102 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site