Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing cgroups support #236

Open
rofafor opened this issue Mar 30, 2024 · 1 comment
Open

Missing cgroups support #236

rofafor opened this issue Mar 30, 2024 · 1 comment

Comments

@rofafor
Copy link

rofafor commented Mar 30, 2024

The current CPU count detector in Linux only uses affinity:

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

@romange
Copy link
Owner

romange commented Apr 8, 2024

wanna send a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants