Re: [PATCH v6 3/9] x86/resctrl: Parse ACPI ERDT table and save CACD cpumask for RMDD domains

From: Chen, Yu C

Date: Tue Aug 25 2026 - 12:19:27 EST


On 8/24/2026 11:54 PM, Reinette Chatre wrote:
Hi Chenyu,


[ ... ]


Yes, code readability is a priority. It is not all just about code readability. Please consider
all the points I mentioned above. I do not see any justification for get_rdt_resources()
leaving dangling state on failure. This is something that will get tripped over in the next
inevitable refactor. Apart from that, adding a single "cleanup" function at one location down in
the call stack is convenient for *this* implementation based on the *current* state of the code but
while doing so it breaks custom, not just of resctrl but of the rest of the kernel also, and because
of that makes this code difficult to build on and maintain.

goto out;

Above is the issue I mentioned earlier where get_rdt_resources() leaves dangling state.
If it cleaned up after itself on failure as is the custom in the kernel then
resctrl_arch_late_init() does not have to.

If the goal is to avoid goto in __resctrl_arch_late_init() then the failure paths that
follow get_rdt_resources() can just call erdt_exit() directly to make obvious where what
needs to be cleaned up.

As the suggestion is implemented the cleanup is inconsistent with __resctrl_arch_late_init()
doing its own cleanup for code run _after_ erdt_init() and leaving the erdt_init() cleanup
to be done further down the stack by __resctrl_arch_late_init()'s caller. While technically
correct this inconsistency adds unnecessary complexity and another place that will get tripped
over in the next inevitable refactor.


I see. This is very helpful guidance. I'll adjust the code accordingly.

thanks,
Chenyu