locked
GetLogicalProcessorInformation API fails for more than 64 cpus!! RRS feed

  • Question

  • Hi,
    I want to find out the logical vs physical cpu mapping on my Windows Server 2003 x86_64 platform.
     
    GetLogicalProcessorInformation  API uses the "SYSTEM_LOGICAL_PROCESSOR_INFORMATION " structure which contains the variable named as "ProcessorMask " of the type "ULONG_PTR ". The max size of this variable is "unsigned __int64 " as it is typedef as below in header file "basetsd.h ".
     
    typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
     
    This much size is working fine for me to get the processor mask value for 2^63. This value is safer if i have a maximum of 64 logical cpus in my server.
    But as soon as number of servers increase from 64, this api stop supporting and provide the wrong results.
    Can you please update if i am wrong in my approach?
    If i am correct, what can be done to resolve this issue?
    Tuesday, May 11, 2010 12:46 PM

Answers

  • Given that Windows Server 2003 only supports a maximu of 64 CPUs, this doesn't seem like a big problem.

    Starting with Windows 7/Windows Server 2008 R2, the kernel supports up to 256 logical processors and adds the new GetLogicalProcessorInformationEx function, which returns a new data structure that can correctly describe more than 64 processors.


    -cd [VC++ MVP] Mark the best replies as answers!
    • Proposed as answer by Carl Daniel Tuesday, May 11, 2010 2:05 PM
    • Marked as answer by Yi Feng Li Monday, May 17, 2010 1:57 AM
    Tuesday, May 11, 2010 2:05 PM

All replies

  • Given that Windows Server 2003 only supports a maximu of 64 CPUs, this doesn't seem like a big problem.

    Starting with Windows 7/Windows Server 2008 R2, the kernel supports up to 256 logical processors and adds the new GetLogicalProcessorInformationEx function, which returns a new data structure that can correctly describe more than 64 processors.


    -cd [VC++ MVP] Mark the best replies as answers!
    • Proposed as answer by Carl Daniel Tuesday, May 11, 2010 2:05 PM
    • Marked as answer by Yi Feng Li Monday, May 17, 2010 1:57 AM
    Tuesday, May 11, 2010 2:05 PM
  • So, it means that we can't find out the correct processor information on Windows Server 2003, in case the server contains more than 64 cpus.

    Actually my target server is Windows Server 2003 only.

    Thursday, May 13, 2010 4:05 AM
  • So, it means that we can't find out the correct processor information on Windows Server 2003, in case the server contains more than 64 cpus.

    Actually my target server is Windows Server 2003 only.


    No, you can find out the corrent information, although it's a subset of what you can get on later OSs.  Win2k3 supports a maximum of 64 processors, so you won't ever have the case of not enough bits in the data structure returned by GetLogicalProcessorInformation when running on Win2k3.
    -cd [VC++ MVP] Mark the best replies as answers!
    Thursday, May 13, 2010 1:05 PM
  • Thanks a lot for the info !
    Friday, May 14, 2010 4:54 AM