Score:0

Ubuntu 20.04 slow after unattended-upgrade and reboot

fr flag

I am seeing significantly worse performance after rebooting. This is noticeable across the entire machine (using apps, browser, terminal, etc.), but I am going to use this particular compilation since it is easy to quantify and I know how much time it should take:

Before:

$ time npm run build:app

# ... snip

real    0m7.545s
user    0m11.205s
sys     0m0.266s

After:

time npm run build:app

# ... snip

real    0m43.877s
user    1m15.089s
sys     0m2.319s

Oof.

This first occurred on September 1st after ignoring the "Your machine needs to reboot after updates" dialog for a couple of days. I tried the following to fix it:

  • Ensure firmware is up to date
  • Installing cpufreq to check that CPU scaling was occurring correctly (I think it is). The issue still occurs both in "Performance" and "Powersave" modes
  • Not running anything else (shutting down services like docker, containerd, nginx, etc.)
  • Unplugging all extraneous USB devices (yeah, I know.)

After giving up and continuing to work with a sluggish machine, on September 2nd, after waking it from slumber, it was inexplicably fixed. Now I dread all future software upgrades.

This week, the "you need a reboot" dialog appeared again, and I purposefully ignored it until today. After reboot, the issue has returned.

$ lscpu
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   39 bits physical, 48 bits virtual
CPU(s):                          16
On-line CPU(s) list:             0-15
Thread(s) per core:              2
Core(s) per socket:              8
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           158
Model name:                      Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Stepping:                        13
CPU MHz:                         2400.000
CPU max MHz:                     5000.0000
CPU min MHz:                     800.0000
BogoMIPS:                        4800.00
Virtualization:                  VT-x
L1d cache:                       256 KiB
L1i cache:                       256 KiB
L2 cache:                        2 MiB
L3 cache:                        16 MiB
NUMA node0 CPU(s):               0-15
Vulnerability Itlb multihit:     KVM: Mitigation: VMX disabled
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Enhanced IBRS, IBPB conditional, RSB filling
Vulnerability Srbds:             Mitigation; TSX disabled
Vulnerability Tsx async abort:   Mitigation; TSX disabled
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_per
                                 fmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic mov
                                 be popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriorit
                                 y ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_
                                 notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities

Here's top:

top - 13:34:51 up 51 min,  1 user,  load average: 0.11, 0.34, 0.42
Tasks: 436 total,   1 running, 435 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.2 us,  0.2 sy,  0.0 ni, 99.6 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  31864.7 total,  27013.6 free,   1493.9 used,   3357.1 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.  29907.1 avail Mem

 PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
3208 root      20   0   24.3g 117428  74468 S   1.0   0.4   1:44.13 Xorg
5000 user      20   0  825840  59472  40508 S   1.0   0.2   0:33.68 gnome-terminal-
1690 root     -51   0       0      0      0 S   0.7   0.0   1:11.28 irq/190-nvidia
1703 root      20   0  273764   9464   8620 S   0.7   0.0   0:13.08 thermald
9183 user      20   0   12364   4476   3256 R   0.7   0.0   0:00.67 top
3396 user      20   0 4642344 483188 122828 S   0.3   1.5   2:39.44 gnome-shell
3593 user      20   0  361428  43756  25164 S   0.3   0.1   0:05.85 indicator-cpufr
   1 root      20   0  170164  12324   8448 S   0.0   0.0   0:02.53 systemd
   2 root      20   0       0      0      0 S   0.0   0.0   0:00.01 kthreadd
   ...
$ service --status-all
 [ + ]  acpid
 [ - ]  alsa-utils
 [ - ]  anacron
 [ + ]  apparmor
 [ + ]  apport
 [ + ]  avahi-daemon
 [ + ]  binfmt-support
 [ + ]  bluetooth
 [ - ]  cgroupfs-mount
 [ - ]  console-setup.sh
 [ + ]  cpufrequtils
 [ + ]  cron
 [ - ]  cryptdisks
 [ - ]  cryptdisks-early
 [ + ]  cups
 [ + ]  cups-browsed
 [ + ]  dbus
 [ - ]  docker
 [ + ]  gdm3
 [ - ]  gdomap
 [ - ]  grub-common
 [ - ]  hwclock.sh
 [ + ]  irqbalance
 [ + ]  kerneloops
 [ - ]  keyboard-setup.sh
 [ + ]  kmod
 [ + ]  loadcpufreq
 [ - ]  lvm2
 [ - ]  lvm2-lvmpolld
 [ + ]  network-manager
 [ - ]  nginx
 [ + ]  openvpn
 [ - ]  plymouth
 [ - ]  plymouth-log
 [ - ]  postgresql
 [ - ]  pppd-dns
 [ + ]  procps
 [ - ]  pulseaudio-enable-autospawn
 [ - ]  rsync
 [ + ]  rsyslog
 [ - ]  saned
 [ - ]  speech-dispatcher
 [ - ]  spice-vdagent
 [ - ]  sysstat
 [ + ]  udev
 [ + ]  ufw
 [ + ]  unattended-upgrades
 [ - ]  uuidd
 [ - ]  virtualbox
 [ + ]  whoopsie
 [ - ]  x11-common

I have apt logs if that will help.

Any assistance would be greatly appreciated!

Update:

Since I know someone is going to ask:

$ nvidia-smi
Sat Sep 11 13:57:39 2021       
+---------------------------------------------+
| NVIDIA-SMI 470.57.02    Driver Version: 470.57.02    CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Quadro RTX 3000     On   | 00000000:01:00.0  On |                  N/A |
| N/A   50C    P8    15W /  N/A |    563MiB /  5934MiB |      4%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+---------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1975      G   /usr/lib/xorg/Xorg                161MiB |
|    0   N/A  N/A      3208      G   /usr/lib/xorg/Xorg                200MiB |
|    0   N/A  N/A      3396      G   /usr/bin/gnome-shell               49MiB |
|    0   N/A  N/A      9375      G   /usr/lib/firefox/firefox          140MiB |
+---------------------------------------------+

Update 2:

Sleep/Hibernate definitely fixes the issue. Came back later and it was fine.

willsters avatar
fr flag
FWIW, I will still be looking to track this down. I've just never experienced suspend actually _improving_ the state of the system.
willsters avatar
fr flag
Experienced this again today. Once again fixed by suspend.
willsters avatar
fr flag
Still affected. I had a look at `sudo rdmsr -a 0x19a` today. All zeroes.
willsters avatar
fr flag
Took another look today. I am still unable to find any differences between `grep . /sys/devices/system/cpu/intel_pstate/*` and `grep . /sys/devices/system/cpu/cpu0/cpu_frequency/*` before and after sleep (I also tried giving CPU 0 a load and checking).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.