Re: [PATCH v6 7/9] dma-buf: system_heap: Enforce shared-granule alignment for cc-shared buffers
From: Aneesh Kumar K . V
Date: Sun Sep 20 2026 - 03:25:06 EST
Jason Gunthorpe <jgg@xxxxxxxx> writes:
> On Sat, Sep 19, 2026 at 08:27:29PM +0530, Aneesh Kumar K.V wrote:
>
>> +static struct page *system_heap_alloc_order(unsigned int order, gfp_t flags,
>> + bool cc_shared)
>> +{
>> + struct cc_shared_pages mem;
>> +
>> + if (!cc_shared)
>> + return alloc_pages(flags, order);
>> +
>> + /* The shared granule can raise the actual allocation order. */
>> + flags |= __GFP_COMP;
>> + if (alloc_cc_shared_pages(flags, PAGE_SIZE << order, &mem))
>> + return NULL;
>
> Oh yeah that's surprisingly easy because of how this loop works with
> order
>
> Makes sense to me
>
>> int alloc_cc_shared_pages_node(int nid, gfp_t gfp, size_t requested,
>> struct cc_shared_pages *mem)
>
> This argument order is a little weird from mm norms?
>
That is similar to
static inline struct page *alloc_pages_node_noprof(int nid, gfp_t gfp_mask,
unsigned int order)
-aneesh