-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
The current CPU count detector in Linux only uses affinity:
helio/util/fibers/proactor_pool.cc
Lines 39 to 44 in ceaa6f8
static cpu_set_t OnlineCpus() { | |
cpu_set_t online_cpus; | |
CPU_ZERO(&online_cpus); | |
CHECK_EQ(0, sched_getaffinity(0, sizeof(online_cpus), &online_cpus)); | |
return online_cpus; | |
} |
Modern containerized systems require use of cgroups that is used to limit resource usage and therefore it should be taken account also in Helio's CPU detection. Please, take a look at e.g. OpenJDK's implementation: https://github.com/openjdk/jdk/blob/37c2279148fa91627137e3af362bfcffde61acd0/src/hotspot/os/linux/cgroupSubsystem_linux.cpp#L449-L513
Metadata
Metadata
Assignees
Labels
No labels