Skip to content

Conversation

last-las
Copy link

@last-las last-las commented Sep 1, 2025

cgroup v2 doesn't have a file similar to cpuacct.usage_all. Therefore, the proc_stat_read in cgroup v2 always falls back to the host's /proc/stat. As a result, the CPU count reported by this file is incorrect, e.g. issues #593 and #654.

However, the similar proc_cpuinfo_read function does report the right CPU counts. It works by filtering the host's file using both cpuset.cpus and cpu.max. This patch fixes proc_stat_read by using the same method.

@stgraber
Copy link
Member

stgraber commented Sep 1, 2025

@last-las can you edit your commit message to include the required Signed-off-by line? (see CONTRIBUTING.md)

@last-las
Copy link
Author

last-las commented Sep 2, 2025

@last-las can you edit your commit message to include the required Signed-off-by line? (see CONTRIBUTING.md)

done!

@stgraber stgraber requested a review from mihalicyn September 2, 2025 03:17
@stgraber
Copy link
Member

stgraber commented Sep 2, 2025

@mihalicyn can you take a look?

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

Successfully merging this pull request may close these issues.

2 participants