Skip to content

Fix additional issue to support >1024 CPUs#127572

Merged
janvorli merged 2 commits into
dotnet:mainfrom
janvorli:fix-one-more-place-for-more-than-1024-cpus
May 13, 2026
Merged

Fix additional issue to support >1024 CPUs#127572
janvorli merged 2 commits into
dotnet:mainfrom
janvorli:fix-one-more-place-for-more-than-1024-cpus

Conversation

@janvorli
Copy link
Copy Markdown
Member

In my previous PR I have missed one case when we only set the affinity. This change fixes it.

In my previous PR I have missed one case when we only set the affinity.
This change fixes it.
@janvorli janvorli added this to the 8.0.x milestone Apr 29, 2026
@janvorli janvorli requested a review from jkotas April 29, 2026 16:43
@janvorli janvorli self-assigned this Apr 29, 2026
Copilot AI review requested due to automatic review settings April 29, 2026 16:43
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/gc
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the CoreCLR GC Unix OS abstraction to fully support machines with more than CPU_SETSIZE (typically 1024) logical CPUs when setting thread affinity, addressing a missed case from a prior change.

Changes:

  • Cache the OS “configured CPU count” during GCToOSInterface::Initialize() for later use.
  • Update GCToOSInterface::SetThreadAffinity() to use dynamically allocated CPU sets (CPU_ALLOC / CPU_*_S) instead of a fixed-size cpu_set_t.

Comment thread src/coreclr/gc/unix/gcenv.unix.cpp Outdated
Comment thread src/coreclr/gc/unix/gcenv.unix.cpp Outdated
@agocke
Copy link
Copy Markdown
Member

agocke commented Apr 29, 2026

@VSadov for review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 30, 2026 14:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates CoreCLR GC’s Unix environment layer to correctly set per-thread CPU affinity on systems with more than CPU_SETSIZE (typically 1024) logical CPUs, addressing a previously missed code path that still used a fixed-size cpu_set_t.

Changes:

  • Cache the OS configured CPU count (g_configuredCpuCount) during GCToOSInterface::Initialize().
  • Switch GCToOSInterface::SetThreadAffinity to use dynamically allocated CPU sets (CPU_ALLOC* + *_S macros) and free them after applying affinity.

Comment thread src/coreclr/gc/unix/gcenv.unix.cpp
@janvorli janvorli closed this May 12, 2026
@janvorli janvorli reopened this May 12, 2026
@janvorli janvorli closed this May 12, 2026
@janvorli janvorli reopened this May 12, 2026
@janvorli janvorli merged commit 081670b into dotnet:main May 13, 2026
130 checks passed
@janvorli janvorli deleted the fix-one-more-place-for-more-than-1024-cpus branch May 13, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants