On Thu, 26 Nov 2026 16:31:37 +0000,
Jason Gunthorpe <[email protected]> wrote:
> 
> On Thu, Nov 26, 2026 at 03:52:00PM +0000, Catalin Marinas wrote:
> > On Tue, Nov 24, 2026 at 09:46:21AM -0400, Jason Gunthorpe wrote:
> > > On Tue, Nov 24, 2026 at 07:00:00PM +0530, Aneesh Kumar K.V wrote:
> > > 
> > > > Taking Jason's feedback into account, we could have the allocator
> > > > request compound pages and recover the actual allocation order with
> > > > compound_order(). That would avoid passing an order to free:
> > > > 
> > > > void *alloc_cc_shared_node(int nid, gfp_t gfp, unsigned int order);
> > > > void *alloc_cc_shared(gfp_t gfp, unsigned int order);
> > > > void free_cc_shared(void *addr);
> > > 
> > > It probably shouldn't be order here, that is hard to use. Just size_t
> > > len
> > > 
> > > And round up internally
> > 
> > Minor point in favour of keeping the '_pages' naming and order is that
> > it makes it more obvious what alignment is returned for code that needs
> > it like the ITS. Otherwise we can just document it, I don't have a
> > strong opinion either way (only that it's simpler than what was proposed
> > earlier).
> 
> All our allocators return things aligned to their size, does ITS need
> higher alignment than that?

Yes. The ITT is always 256 byte aligned, irrespective of the size
(5.3.10 MAPD), and the command queue always aligned to 64kB,
irrespective of the size (5.2.8 The ITS command interface).

This mean that you can end up with a 16 byte ITT aligned to 256 bytes,
and a 4kB command queue aligned to 64kB.

We can of course avoid all of that by wasting even more memory, which
I am definitely happy to.

        M.

-- 
Without deviation from the norm, progress is not possible.

Reply via email to