RFR: 8371701: Add ability to set NUMA-affinity for threads
Albert Mingkun Yang
ayang at openjdk.org
Wed Nov 12 14:59:34 UTC 2025
On Wed, 12 Nov 2025 13:35:12 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:
>> This interpretation makes sense, but what should callers do with the `false` case?
>>
>> (In #28262, the return-value is just ignored, isn't it?)
>
> Yes we ignore the return value in https://github.com/openjdk/jdk/pull/28262 since the algorithm and functionality works if setting the affinity would fail for some reason. If the return type is false a user could bail or revert to some other strategy. I added the boolean return type as a way for users to have insight into the actual result of the operation, if they care.
NUMA affinity is a performance hint, not a requirement. Callers can’t meaningfully react to failure -- retry is unlikely to succeed, and there’s no feasible fallback strategy in most contexts.
> since the algorithm and functionality works if setting the affinity would fail
I can't think of a scenario where numa-affinity affects correctness.
Ofc, this is very subjective. Up to you.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28261#discussion_r2518645095
More information about the hotspot-runtime-dev
mailing list