Thread (34 messages) flat view 34 messages, 5 authors, 11h ago

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

From: Jason Gunthorpe <jgg@ziepe.ca>
Date: 2026-09-19 21:35:34
Also in: kvmarm, linux-coco, linux-iommu, lkml

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help