Closed Napsty closed 9 months ago
I think there was a change regarding CPU handling between 3.2.1 and 3.2.2 that @fasterit can shed some more light onto.
May be something related to: #993, #995, #1004, #1197, …
Maybe duplicate of or at least related to https://github.com/htop-dev/htop/issues/1020
Actually I'm mistaken! htop 3.2.2 compiled from source looks similar to the output of 3.2.1. This is with htop 3.2.2 compiled from the release htop-3.2.2.tar.xz:
root@bookworm:~/htop-3.2.2# ./htop --version
htop 3.2.2
The problem with the wrong cpu count seems to come from the htop package in the Debian repositories. There was a manual patch added in the package:
The patch in question:
That patch is the same as the PR #1197. Manually applying PR 1197 on htop 3.2.2 source code leads to the same wrong cpu count. If I see this correctly, htop 3.3.0 (milestone) would contain this problem again.
First of all thanks for
htop
. Been using it for years and it's an enormous helper!Today I've used
htop
the first time in a Debian 12 (Bookworm) running as a LXC container. I was surprised to see the full amount of physical cores in the htop output:At first I suspected a problem in LXC, that the cgroup limits don't work anymore in a Bookworm container (see https://discuss.linuxcontainers.org/t/cgroup2-cpu-limit-no-longer-working-after-lxc-container-upgraded-to-debian-12) but then realized that it might be a htop problem.
After manually compiling htop 3.2.1, I can actually confirm this. Here's the htop 3.2.1 output on the very same LXC container:
Here we get to see two CPUs in the output, which represents the cgroup limit defined on the host.
(Available memory is correctly shown in both htop versions by the way).
I noticed the following line in the changelog:
https://github.com/htop-dev/htop/blob/main/ChangeLog#L22C3-L22C64
Maybe that's where this comes from?