Re: [PATCH v6 7/9] dma-buf: system_heap: Enforce shared-granule alignment for cc-shared buffers

From: Jason Gunthorpe

Date: Sat Sep 19 2026 - 17:37:59 EST


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?

Jason