Fix CPU count in unit tests when >64 CPUs
On Windows systems with > 64 logical processors, the processor count returned by base::SysInfo::NumberOfProcessors() is below the actual count. This is because Windows splits logical processors on systems with more than 64 into Processor Groups, and an accurate count of system processors requires using newer Windows API call ::GetActiveProcessorCount(ALL_GROUPS), which counts processors across all groups. For most code in Chrome, using more than one processor group's processors is likely overkill (and requires additional code to assign each thread to a processor group), so this change does not modify the existing base::SysInfo::NumberOfProcessors() - it will still reflect the number of processors in the calling process's group. Instead, this change modifies the test launcher itself, as that is the only currently known use case for running on more than one processor group's processors. On the 72-core P920 (which has two groups containing 36 CPUs each), when running base_unittests.exe, this change has the following effect: Before: C:\src\chromium\src>out\Default\base_unittests.exe [...] Using 36 parallel jobs. After: C:\src\chromium\src>out\Default\base_unittests.exe [...] Using 72 parallel jobs. Bug: 983014 Change-Id: Ie7a828b4fba9f2e8e7f220738af58d5de8e17816 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1704388Reviewed-by:Erik Chen <erikchen@chromium.org> Commit-Queue: Jesse McKenna <jessemckenna@google.com> Cr-Commit-Position: refs/heads/master@{#696927}
Showing
Please register or sign in to comment