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

Correctly show /sys/devices/system/cpu/cpu*/online, currently all threads are always shown online #627

Open
C0rn3j opened this issue Jan 31, 2024 · 4 comments
Labels
Maybe Undecided whether in scope for the project

Comments

@C0rn3j
Copy link

C0rn3j commented Jan 31, 2024

#88 partially solved the online issues by showing correct overall view in /sys/devices/system/cpu/online

However online marker in /sys/devices/system/cpu/cpu*/online is always set to 1, i.e. online.

# cpu.limit = 6, but all 48 threads are set to online in the distinct files
cat /sys/devices/system/cpu/online /sys/devices/system/cpu/cpu*/online
2,5,19,21,24,30
1
1
1
1
1
1
1
1
1
1
1
1
…

This is on LXD 5.19 with 5.15.0-58-generic kernel.

@mihalicyn
Copy link
Member

Hi @C0rn3j!

Your suggestion is to show all CPUs except 2,5,19,21,24,30 (in your example case) like offlined ones, right?

WDYT @stgraber?

@mihalicyn mihalicyn added the Maybe Undecided whether in scope for the project label Mar 20, 2024
@mihalicyn
Copy link
Member

mihalicyn commented Mar 20, 2024

It can also be very very useful if you provide a bit of extra context why this is important (for example, you have piece of (open-source) software X that does not work correctly because of that).

@C0rn3j
Copy link
Author

C0rn3j commented Mar 20, 2024

Your suggestion is to show all CPUs except 2,5,19,21,24,30 (in your example case) like offlined ones, right?

Indeed!

It can also be very very useful if you provide a bit of extra context why this is important (for example, you have piece of (open-source) software X that does not work correctly because of that).

It breaks htop, as its fallback logic when online threads aren't actually online is wrong.

I've sent a PR for that actually, but I don't think it would have been necessary if the CPUs were reported as offline in the first place.

htop-dev/htop#1394

@stgraber
Copy link
Member

@mihalicyn having the CPUs listed but having LXCFS fake them being offline should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maybe Undecided whether in scope for the project
Development

No branches or pull requests

3 participants