Skip to content

[Driver/C] add topology checks (die locality, L3 cache sharing) for configured affinities - #2120

Open
EmilJohn24 wants to merge 15 commits into
masterfrom
feature/affinity_validation
Open

[Driver/C] add topology checks (die locality, L3 cache sharing) for configured affinities#2120
EmilJohn24 wants to merge 15 commits into
masterfrom
feature/affinity_validation

Conversation

@EmilJohn24

@EmilJohn24 EmilJohn24 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Changes driver thread CPU pinning and Linux startup path for affinity/cpuset; misconfiguration could affect latency-sensitive agent isolation, though behavior is mostly additive warnings plus clearer separation of configured vs resolved CPUs.

Overview
Expands Linux driver startup affinity handling by routing aeronmd through aeron_driver_validate_and_apply_affinity_configuration instead of only aeron_driver_apply_cpuset_affinity.

The driver now keeps configured affinity indices (*_cpu_affinity_no) separate from resolved CPUs (*_cpu_affinity_resolved). Cpuset mapping writes only the resolved fields; thread pinning uses those resolved values so configured settings stay visible in dumps and APIs.

New warnings (rolled into the existing cpuset_warnings_as_errors total): duplicate affinity across conductor/sender/receiver/native resource agent pairs; L3 cache domain spread for resolved affinities (via new aeron_topology_build_l3_group_table); die locality spread (via aeron_topology_build_die_locality_group_table). Topology helpers add aeron_topology_cpu_info_t and related grouping APIs.

Tests cover cpuset resolution behavior, L3/die group tables, and the new validation functions.

Reviewed by Cursor Bugbot for commit 3f8b57c. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread aeron-driver/src/main/c/aeron_topology.c
Comment thread aeron-driver/src/main/c/aeron_topology.c
@EmilJohn24
EmilJohn24 force-pushed the feature/affinity_validation branch from ff50ea4 to 29d76b7 Compare August 17, 2026 02:25
Comment thread aeron-driver/src/main/c/aeron_driver_context.c
Comment thread aeron-driver/src/main/c/aeron_topology.c
Comment thread aeron-driver/src/test/c/aeron_driver_test.cpp

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 68c0f91. Configure here.

aeron_free(cpus);
return -1;
#endif
return 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-Linux skips cpuset affinity errors

Low Severity

aeron_driver_validate_and_apply_affinity_configuration is entirely wrapped in #ifdef __linux__, so on other platforms it always returns success. Enabling cpuset_affinity outside Linux used to fail in aeron_driver_apply_cpuset_affinity; that error path is no longer reached.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 68c0f91. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants