Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Issue 8973 - core.cpuid.coresPerCPU returning incorrect value. #1351

Merged
merged 1 commit into from Aug 23, 2015
Merged

Issue 8973 - core.cpuid.coresPerCPU returning incorrect value. #1351

merged 1 commit into from Aug 23, 2015

Conversation

HK47196
Copy link
Contributor

@HK47196 HK47196 commented Aug 20, 2015

maxCores for AMD is currently calculated using the theoretical maximum number of cores, not the actual enabled maximum number of cores.

This causes all bulldozer CPUs(and possibly others) to report the wrong value.

http://support.amd.com/TechDocs/25481.pdf

The size of this field determines the maximum number of cores (MNC) that the processor could theoretically support, not the actual number of cores that are actually implemented or enabled on the processor, as indicated by CPUID Fn8000_0008_ECX[NC].

issue

while (apicsize) { maxCores<<=1; --apicsize; }
//http://support.amd.com/TechDocs/25481.pdf pg.36
maxCores = 1;
if (hyperThreadingBit) {
Copy link
Member

Choose a reason for hiding this comment

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

This is reffered to a legacy method. Any reasons the so-called extended method cannot be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using NC is the listed way to do it under the extended method. I believe the 'legacy' is referring to the deprecated LogicalProcessorCount, not NC.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, you are right. All bits were confusingly list in legacy method section, still the only legacy fields are LogicalCpuCount and CmpLegacy

@DmitryOlshansky
Copy link
Member

Auto-merge toggled on

DmitryOlshansky added a commit that referenced this pull request Aug 23, 2015
Issue 8973 - core.cpuid.coresPerCPU returning incorrect value.
@DmitryOlshansky DmitryOlshansky merged commit f3d9ec7 into dlang:master Aug 23, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants