Skip to content

fix(core_affinity2): use real core IDs for --cores all - #3925

Open
devAL3X wants to merge 1 commit into
AFLplusplus:mainfrom
devAL3X:fix-cores-all-ids
Open

devAL3X wants to merge 1 commit into
AFLplusplus:mainfrom
devAL3X:fix-cores-all-ids

Conversation

@devAL3X

@devAL3X devAL3X commented Sep 25, 2026

Copy link
Copy Markdown

Description

Fix --cores all to use the actual CPU IDs returned by the system affinity mask instead of assuming that CPU IDs are consecutive starting from zero.
This is important when the process is restricted to a non-contiguous set of CPUs, for example 1,3,7. The same issue can occur when CPU resources are limited through Linux cgroups or container CPU constraints.

Checklist

  • I have run ./scripts/precommit.sh and addressed all comments

Copilot AI lite review requested due to automatic review settings September 25, 2026 16:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The implementation addresses non-contiguous CPU IDs; the remaining regression-test request is a minor nit.

Review effort: Lite
Findings: None

What changed in this PR

Fixes --cores all to use actual CPU IDs from the process affinity mask, including non-contiguous allocations.

Changes:

  • Uses get_core_ids() instead of sequential IDs.
  • Supports cgroup and container CPU constraints.
File Summary
crates/​core_affinity2/​src/​lib.rs Uses affinity-derived CPU IDs for all.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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