GNOME Bugzilla – Bug 352807
misbehaves with Linux' CPU hotplug/unplug
Last modified: 2018-01-10 19:45:01 UTC
Please describe the problem: GNOME System Monitor is totally unaware of CPU Hotplug/Hotremove events. It also have problem with "sparse" cpu numbers. Steps to reproduce: Scenario A: 1. Run System Monitor 2. Unplug CPU (echo 0 > /sys/devices/system/cpu/cpu1/online) Scenario B: 1. Unplug CPU 2. Run System Monitor 3. Plug CPU (echo 1 > /sys/devices/system/cpu/cpu1/online) Scenario C: 1. Run System Monitor on 4-way SMP system. 2. Unplug second or third CPU Actual results: Scenario A: Unplugged CPU's line goes flat, but CPU is still displayed Scenario B: Freshly plugged-in CPU do not appear in monitor. Scenario C: SERIOUS! System Monitor shows only one (if second CPU was unplugged) or two (if third CPU) CPU's graphs. It doesn't show fourth (and third) CPU's graph. Expected results: Scenario A: Unplugged CPU's label should be grayed-out and percent display should be changed to "offline". Scenario B: Freshly plugged CPU should either: a) appear b) be un-grayed-out (see Scenario A expected action) Scenario C: CPUs 3 and 4 should be shown even if CPU2 is disabled. System Monitor shouldn't stop enumerating CPUs on first offline one. Does this happen every time? Yes. Other information: Multicore laptops are becoming standard, and power management policy could turn off (unplug) unused CPUs. So this is rather imporant drawback in GNOME System Monitor.
I can confirm this bug. I've got it with Version 2.28.0-0ubuntu1 on an Intel E5520 and with Version 2.16.0 (CentOS 5.4) on a Tyan VX50. I wonder why it was not fixed although it is known for a long time and pretty sticky over a lot of versions.
I can still reproduce this on Gnome System Monitor git HEAD. Also see downstream report for ubuntu: https://bugs.launchpad.net/gnome-system-monitor/+bug/810498.
Reassigning this to libgtop, the library getting us the CPU information, as it determines the number of CPUs the following way [1]: starts reading /proc/stat line by line, increases a counter with each line, and checks if the line starts with cpu%d, counter. In case e.g cpu2 is offline, /proc/stat only has cpu0, cpu1, cpu3 on a quad-core, but as line 3 doesn't start with cpu2, but starts with cpu3, it stops counting the number of cores and tells system monitor that there are only 2 cores, cpu0 and cpu1. [1] http://git.gnome.org/browse/libgtop/tree/sysdeps/linux/open.c#n82
*** Bug 732305 has been marked as a duplicate of this bug. ***
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libgtop/issues/6.