This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Changeset 9870 for ps


Ignore:
Timestamp:
07/18/11 10:08:06 (13 years ago)
Author:
Jan Wassenberg
Message:

fix for non-contiguous APIC IDs within a single package (happens on recent Intel CPUs)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/lib/sysdep/arch/x86_x64/topology.cpp

    r9786 r9870  
    329329{
    330330    const size_t contiguousId = IndexFromApicId(cpuTopology.sortedApicIds, apicId);
    331     return cpuTopology.logical(contiguousId);
     331    return contiguousId % cpuTopology.logicalPerCore;
    332332}
    333333
     
    335335{
    336336    const size_t contiguousId = IndexFromApicId(cpuTopology.sortedApicIds, apicId);
    337     return cpuTopology.core(contiguousId);
     337    return (contiguousId / cpuTopology.logicalPerCore) % cpuTopology.coresPerPackage;
    338338}
    339339
     
    341341{
    342342    const size_t contiguousId = IndexFromApicId(cpuTopology.sortedApicIds, apicId);
    343     return cpuTopology.package(contiguousId);
     343    return contiguousId / (cpuTopology.logicalPerCore * cpuTopology.coresPerPackage);
    344344}
    345345
Note: See TracChangeset for help on using the changeset viewer.