htop-dev / htop

htop - an interactive process viewer
https://htop.dev/
GNU General Public License v2.0
6.44k stars 439 forks source link

Dynamic CPU addition is not shown Redhat Linux ppc64le #430

Open giannakopoulosj opened 3 years ago

giannakopoulosj commented 3 years ago

Issue: Can the dynamic addition of CPUs be depicted without closing and opening htop??

Steps to depict the issue:

Platform Redhat8 ppc64le, the Virtual Processors configuration of the node is 3. this will show 24 CPUs in htop as per screenshot. image By dynamically increasing it from HMC to 4 Virtual Processors, in order to have the correct view i have to close and reopen htop. In the following screenshot is the htop on the same machine after the addition of 1 VP and opened it in new window image


In contrast when i have 4, and i substract 1 Virtual Processor i get correct view. image

Even if i give back the 1 Virtual Processor i will get the correct view and CPUs that are absense will be repopulate. image

giannakopoulosj commented 3 years ago

Hello @BenBE could this be requested as new feature?

BenBE commented 3 years ago

As far as I see it (code-wise) there's probably at least two distinct issues here at play. The first one is, that certain structures are sized only at the start, thus additional CPUs aren't necessarily noticed at runtime. The second issue is that the resizing of meters is currently hardly implemented, thus even if we had the additional information in the meter, there might still lay some issues ahead resizing the CPU meters to actually display them.

giannakopoulosj commented 3 years ago

Regarding the draw issue. In ppc64le Linux the potential range of CPUs could be get from /sys/.../cpu/possible This could define the max CPU draw area and the max CPU depiction on cpu section of htop (draw all online and offline CPUs) Since this is the higher value that the system may get. To get higher shutdown is needed and lpar profile change must be done before bootup. The offline CPUs instead of absent could note offline. Any dynamic change will bring the usage in depiction as per current functionality when absent CPUs are repopulated. I don't know if the above make more trouble ... :/

[root@rhel8poc htop-master]# cat /sys/devices/system/cpu/online 
0-23
[root@rhel8poc htop-master]# cat /sys/devices/system/cpu/offline 
24-31
[root@rhel8poc htop-master]# cat /sys/devices/system/cpu/possible 
0-31