RE: [PATCH v1] fs/resctrl: Allocate rmid_ptrs[] using kvzalloc_objs()

From: Luck, Tony

Date: Fri Jul 10 2026 - 11:50:08 EST


> On an MPAM system the number of entries in rmid_ptrs[] is the number of PARTIDs
> multiplied by the number of PMGs. The maximum possible number of PARTIDs is
> 0x10000 and the maximum number of PMGs is 0x100. On a system pushing the limits
> of the MPAM specification this can be large enough to consistently fail the
> kzalloc_objs() allocation and hence fail to mount the resctrl filesystem.

Wow!. 16 million RMIDs * 32 byte per structure = 512MB

I generally don't sweat "big" allocations on servers that have hundreds of Gbytes
of memory. But that seems like a lot. Probably 99.99% of it never used (unless
users regularly use resctrl to create tens of thousands of mon_data directories).

Your fix is fine. So

Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx>

But maybe at some point resctrl needs some sparse, or on-demand, allocator for
RMIDs? Or is this a theoretical issue and nobody is likely to build a system that
implements that many PARTIDs and/or PMGs?

-Tony