Public bug reported:

## Summary

On Ubuntu 26.04.1 LTS with GNOME Shell 50.1, Mutter 50.1, Wayland and
NVIDIA driver 595.99.02, `gnome-shell` consumes approximately 100% of
one logical CPU core for about 10 seconds whenever the screen is locked
or automatically blanked through DPMS.

The issue is consistently reproducible and causes a noticeable CPU
temperature spike and a brief increase in system fan noise.

Profiling with `perf` reveals an exceptionally high number of
`timerfd_settime()` system calls during the transition.

The issue did not occur on the same hardware with Ubuntu 24.04.

## System information

- OS: Ubuntu 26.04.1 LTS (Resolute Raccoon)
- Kernel: 7.0.0-43-generic
- Architecture: x86_64
- CPU: Intel Core i9-14900K
- Motherboard: MSI MAG Z790 TOMAHAWK WIFI (MS-7D91)
- RAM: 64 GB
- GPU: NVIDIA GeForce RTX 4070 Ti SUPER
- NVIDIA driver: 595.99.02
- GNOME Shell: 50.1-0ubuntu1.5
- Mutter (`libmutter-18-0`): 50.1-0ubuntu2.5
- Display server: Wayland
- Display connection: DisplayPort
- NVIDIA DRM modeset: Y
- NVIDIA DRM fbdev: Y
- Secure Boot: Enabled

## Steps to reproduce

1. Log in to Ubuntu 26.04 using the default GNOME Wayland session.
2. Open a terminal and monitor CPU usage:

   `pidstat -u -p ALL 1`

3. Lock the screen using Super+L.
4. Wait approximately 10–15 seconds.
5. Unlock the screen and inspect the CPU usage.

Alternatively:

1. Configure automatic screen blanking after 60 seconds.
2. Leave the computer idle until the display enters its power-saving state.
3. Monitor the `gnome-shell` process.

Both methods reproduce the problem.

## Expected behavior

GNOME Shell should transition into the locked or blanked state without
sustained high CPU utilization.

System fans should not suddenly accelerate due to unnecessary CPU
activity during a routine screen power-management transition.

## Actual behavior

Every screen-lock or automatic screen-blanking event causes:

- Approximately 90–101% CPU utilization by `gnome-shell` for about 10 seconds.
- CPU package temperature rising from approximately 37°C to 65–66°C.
- Noticeably increased fan noise for approximately 1–2 seconds.
- CPU utilization returning to normal after the transition.

The screen remains functional, and the system does not crash.

## CPU measurements

Using `pidstat` during automatic screen blanking:

| Time | gnome-shell CPU |
|---|---:|
| 15:29:52 | 3% |
| 15:29:53 | 91% |
| 15:29:54 | 101% |
| 15:29:55 | 100% |
| 15:29:56 | 101% |
| 15:29:57 | 100% |
| 15:29:58 | 100% |
| 15:29:59 | 99% |
| 15:30:00 | 99% |
| 15:30:01 | 100% |
| 15:30:02 | 100% |
| 15:30:03 | 23% |
| 15:30:04 | 0% |

These values represent approximately one fully utilized logical CPU
core.

## perf profiling results

Profiling `gnome-shell` using:

```bash
sudo perf record \
  -e cpu-clock \
  -F 99 \
  -g \
  --call-graph dwarf,4096 \
  -p "$GNOME_PID" \
  -o /tmp/gnome-lock-perf.data \
  -- sleep 20
```

The resulting profile contained 967 samples with zero lost samples.

The highest-overhead functions included:

| Function | Overhead |
|---|---:|
| timerfd_settime | 15.10% |
| VDSO time-related operations | 9.82% |
| g_source_ref | 8.48% |
| GLib internal function | 6.62% |
| _raw_spin_unlock_irq | 4.96% |
| g_mutex_unlock | 4.86% |
| g_mutex_lock | 4.14% |

The call stacks include:

- `g_main_loop_run`
- `meta_context_run_main_loop`
- `gjs_context_eval_module`

This suggests excessive activity in the GLib/GNOME event loop,
potentially involving timer rearming.

## timerfd_settime syscall measurements

Using:

```bash
sudo perf stat \
  -e syscalls:sys_enter_timerfd_settime \
  -p "$GNOME_PID" \
  -- sleep 15
```

Normal desktop operation:

- 89 calls in 15.01 seconds
- Approximately 5.93 calls per second

During a 20-second screen-lock test:

- 1,785,295 calls in 20.01 seconds
- Approximately 89,265 calls per second averaged over the test interval

This represents approximately a 15,000-fold increase in the average
syscall rate between the two measurement intervals.

Because the elevated CPU utilization lasts approximately 10 seconds, the
instantaneous syscall rate during the busy period may differ from the
20-second average.

## Additional troubleshooting

The following tests have already been performed:

1. **Disabled user GNOME Shell extensions:** No improvement.
2. **Tested the standard GNOME session instead of Ubuntu GNOME:** Issue 
persists.
3. **Physically powered off the DisplayPort monitor:** Does not trigger the 
issue.
4. **Allowed GNOME to automatically blank the display:** Reproduces the issue.
5. **Monitored NVIDIA GPU fans:** Remained at 0% during the measured event.
6. **Monitored CPU temperatures:** Reproducible temperature increase to 
approximately 65–66°C.
7. **Checked NVIDIA DRM kernel parameters:** Both `modeset` and `fbdev` enabled.
8. **Checked kernel journal for NVIDIA/DRM errors:** No matching messages were 
recorded during the tested transition.

The measured NZXT Kraken fan remained approximately 630 RPM. The
specific fan responsible for the audible increase has not yet been
identified.

## Suspected cause

The measurements suggest a timer-related busy loop within the GNOME
Shell/Mutter event loop, triggered by screen locking or DPMS power-state
transitions.

The NVIDIA/Wayland display-management path may be involved, but the
exact origin has not been established.

A potentially related previous report is:

https://bugs.launchpad.net/bugs/2142820

That report refers to GNOME Shell consuming 100% CPU when the monitor is
off with NVIDIA drivers. However, it is unclear whether the same
underlying issue is present in the currently installed Mutter 50.1
Ubuntu packages.

## Regression

The problem was not observed on Ubuntu 24.04 on the same computer.

It is consistently reproducible on Ubuntu 26.04.1 LTS.

## Request

Could the Ubuntu Desktop/Mutter maintainers investigate the excessive
`timerfd_settime()` activity during GNOME screen-lock and DPMS
transitions?

I can provide the complete `perf` profile, `pidstat` logs, GPU telemetry
and temperature measurements if needed.

** Affects: mutter (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "Diagnostic logs and performance profiling data collected 
on Ubuntu 26.04.1 LTS (GNOME Shell 50.1, Mutter 50.1, NVIDIA 595.99.02, 
Wayland).  The archive contains CPU utilization logs, perf profiling results, 
timerfd_settime syscall statistics, CPU temperature measurements, and NVIDIA 
GPU telemetry.  The logs demonstrate approximately 100% utilization of one 
logical CPU core for about 10 seconds during screen locking and automatic 
display blanking, accompanied by 1,785,295 timerfd_settime syscalls in a 
20-second test and a CPU temperature increase from 37°C to 65–66°C.  The issue 
is consistently reproducible and was not present on Ubuntu 24.04 using the same 
hardware."
   
https://bugs.launchpad.net/bugs/2173768/+attachment/6016354/+files/ubuntu-26.04-gnome-lock-bug.zip

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to mutter in Ubuntu.
https://bugs.launchpad.net/bugs/2173768

Title:
  [Ubuntu 26.04][NVIDIA/Wayland] GNOME Shell busy-loops on
  timerfd_settime during screen lock and DPMS blanking (100% CPU)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/2173768/+subscriptions


-- 
desktop-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to