On Tue, Dec 01, 2026 at 08:08:21PM +0530, Aneesh Kumar K.V wrote:

> Yes, the allocation size is a power-of-two multiple of the sharing
> granule, since the sharing granule is itself a power-of-two multiple of
> PAGE_SIZE. However, is that the clearest way to document it? The code
> does:
> 
>       cc_shared_round_size(len, &size);
>       order = get_order(size);
>       page = alloc_pages(gfp, order);
> 
> Would it be clearer to describe the returned alignment in terms of
> PAGE_SIZE and the resulting order?

The API is "The alocation is aligned to the request size".

You can mention it is over allocated to fit the platform's
shared/private granule so is very ineffecitient for small allocations.

> The ITS code already sizes its requests assuming that the allocator
> returns memory aligned to the allocation size. Since the new allocator
> preserves that guarantee, I thought those requests would continue to
> meet the ITS alignment requirements.

Sounds great

Jason

Reply via email to