Skip to content

handle case of Proc Index > MAX_SUPPORTED_CPUS#109295

Merged
mangod9 merged 5 commits into
dotnet:mainfrom
mangod9:max_cpu
Oct 30, 2024
Merged

handle case of Proc Index > MAX_SUPPORTED_CPUS#109295
mangod9 merged 5 commits into
dotnet:mainfrom
mangod9:max_cpu

Conversation

@mangod9

@mangod9 mangod9 commented Oct 28, 2024

Copy link
Copy Markdown
Member

this issue affects x86 apps running on machine with > 64 cores.

@mangod9 mangod9 marked this pull request as ready for review October 29, 2024 04:09
@mangod9 mangod9 requested review from a team and Maoni0 October 29, 2024 04:09

@mrsharm mrsharm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

Comment thread src/coreclr/gc/gc.cpp
uint32_t proc_no = GCToOSInterface::GetCurrentProcessorNumber();
int adjusted_heap = proc_no_to_heap_no[proc_no];
// proc_no could likely exceed MAX_SUPPORTED_CPUS on x86
int adjusted_heap = proc_no_to_heap_no[proc_no % MAX_SUPPORTED_CPUS];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know this was code from before but do we need adjusted_heap to be signed? Will there ever be a case where adjusted_heap is negative?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

don't believe that could occur.

Comment thread src/coreclr/gc/gc.cpp Outdated

@Maoni0 Maoni0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@mangod9 mangod9 merged commit 95bae2b into dotnet:main Oct 30, 2024
@mangod9 mangod9 deleted the max_cpu branch October 30, 2024 19:57
@mangod9

mangod9 commented Oct 30, 2024

Copy link
Copy Markdown
Member Author

/backport to release/9.0-staging

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/11600698630

@mangod9

mangod9 commented Oct 30, 2024

Copy link
Copy Markdown
Member Author

/backport to release/8.0-staging

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/11600735639

@github-actions github-actions Bot locked and limited conversation to collaborators Nov 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants