Process systemd-logind constant 3-7%CPU usage, scanning camera and audio devices

Did you try as root / devel-su? That should show ALL processes.

1 Like

Oh, not! :slight_smile: I’ll try later, thanks!

Vlagged, no specific apps installed. And nevermind, i kill all apps when this bug comes, and this not helps. It connected with Browser work, i sure.

And somehow restarting launcher (main screen, lipstick) from Settings - Utilities helps! Cpu become to sleep good again.

So this is Browser+lipstick bug. Main components of OS… :frowning:

Xperia XA2. 4.6.0.13, as in my sign.

Becoming root does not make a difference, nemo or defaultuser sees the same list of processes, there are no processes hidden for users.

2 Likes

Does it affects Cpu/temperature after a notification is received? It might be a vase needing Project: sailfishos-notification-preview-high-cpu-usage-patch (you can install it through Patch Manager by looking into the Web Catalog)

I suspect I have same issue, I noticed that my battery life got worse suddenly, and crest showed systemd-logind and systemd-udevd with 20-30% usage.

Investigating with htop shows CPU usage spiking periodically. With the screen off htop shows even 70+% prolonged usage for systemd-logind during these spikes, with the screen on cpu usage spikes may appear, but these services do not always appear to be the cause.

Using trace, when screen is off, it can be seen that it spends lots of time doing open_at:

systemd-logind screen off

openat(19, "card0", O_RDONLY|O_LARGEFILE|O_NOFOLLOW|O_CLOEXEC|O_PATH) = 18
fstat64(18, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
close(19)                               = 0

...

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 23.69    3.419493          76     44980           openat
 20.49    2.957528          65     44980           close
 19.98    2.883829      151780        19           epoll_wait
 17.84    2.575281          62     40951           fstat64
  3.98    0.573906          72      7891           read
  3.73    0.538043          90      5965           readlinkat
  2.98    0.429861         108      3966           access
  1.99    0.286792          72      3968           getuid32
...

With the screen on, systemd-logind processes seems to spend all (or most) of their time in epoll_wait, which might be expected (?):

systemd-logind screen on

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00  560.319002    56031900        10           epoll_wait
  0.00    0.003293         109        30           clock_gettime
...

systemd-udevd appears to spend most of the time at epoll_wait, regardless of screen being off:

systemd-udevd screen off

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 95.83   20.361790       27778       733           epoll_wait
  0.98    0.207701          88      2347           clock_gettime
  0.92    0.195842         709       276           close

systemd-udevd screen on

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 98.91   52.486729      133554       393           epoll_wait
  0.26    0.137046        2141        64           clone
  0.24    0.127409         101      1251           clock_gettime
....

Please enter this before “it happens”:

journalctl -f -u systemd-udevd -u systemd-logind

Then “make it happen”.

journalctl does not show any output for these two services.

journalctl / dmesg on the other hand shows spam related to suspend:

Jun 05 10:09:11 XperiaXA2 kernel: Restarting tasks ...
Jun 05 10:09:11 XperiaXA2 kernel: R0: [cds_mc_thread][2296257273443] [10:09:11.527455]  wlan: [30991:E :WMA] Invalid length for GTK status
Jun 05 10:09:11 XperiaXA2 kernel: done.
Jun 05 10:09:11 XperiaXA2 kernel: PM: suspend exit 2025-06-05 07:09:11.563475904 UTC
Jun 05 10:09:11 XperiaXA2 kernel: PM: suspend entry 2025-06-05 07:09:11.563510382 UTC
Jun 05 10:09:11 XperiaXA2 kernel: PM: Syncing filesystems ... done.
Jun 05 10:09:11 XperiaXA2 kernel: Freezing user space processes ... (elapsed 0.009 seconds) done.
Jun 05 10:09:11 XperiaXA2 kernel: Freezing remaining freezable tasks ... (elapsed 0.003 seconds) done.
Jun 05 10:09:11 XperiaXA2 kernel: Suspending console(s) (use no_console_suspend to debug)
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:8][2296259606661] [10:09:11.648972]  wlan: [22958:I :HDD] hdd_suspend_wlan: 1298: WLAN being suspended by OS
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:8][2296259606862] [10:09:11.648982]  wlan: [22958:I :HDD] hdd_suspend_wlan: 1318: Disabling queues for dev mode QDF_STA_MODE
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:8][2296259608337] [10:09:11.649059]  wlan: [22958:I :HDD] hdd_suspend_wlan: 1318: Disabling queues for dev mode QDF_P2P_DEVICE_MODE
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:6][2296259907817] [10:09:11.664657]  wlan: [3690:I :HDD] __wlan_hdd_bus_suspend: 667: starting bus suspend; event:2, flags:0
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:6][2296259909482] [10:09:11.664743]  wlan: [3690:I :WMI] suspend type: WOW_IFACE_PAUSE_DISABLED
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:6][2296259949762] [10:09:11.666841]  wlan: [3690:I :HIF] hif_snoc_setup_wakeup_sources: expecting wake from ce 2, irq 152 enable 1
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:6][2296259950036] [10:09:11.666855]  wlan: [3690:I :HDD] __wlan_hdd_bus_suspend: 711: bus suspend succeeded
Jun 05 10:09:11 XperiaXA2 kernel: PM: suspend of devices complete after 19.195 msecs
Jun 05 10:09:11 XperiaXA2 kernel: PM: late suspend of devices complete after 4.936 msecs
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:6][2296260124574] [10:09:11.675946]  wlan: [3690:I :HDD] __wlan_hdd_bus_suspend_noirq: 770: start bus_suspend_noirq
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:6][2296260124907] [10:09:11.675963]  wlan: [3690:I :HDD] __wlan_hdd_bus_suspend_noirq: 803: bus_suspend_noirq done
Jun 05 10:09:11 XperiaXA2 kernel: PM: noirq suspend of devices complete after 3.645 msecs
Jun 05 10:09:11 XperiaXA2 kernel: Disabling non-boot CPUs ...
Jun 05 10:09:11 XperiaXA2 kernel: suspend ns:  102615401125694        suspend cycles:    2296261471299
Jun 05 10:09:11 XperiaXA2 kernel: resume cycles:    2296261615693
Jun 05 10:09:11 XperiaXA2 kernel: Enabling non-boot CPUs ...
Jun 05 10:09:11 XperiaXA2 kernel:  cache: parent cpu1 should not be sleeping
Jun 05 10:09:11 XperiaXA2 kernel: CPU1 is up
Jun 05 10:09:11 XperiaXA2 kernel:  cache: parent cpu2 should not be sleeping
Jun 05 10:09:11 XperiaXA2 kernel: CPU2 is up
Jun 05 10:09:11 XperiaXA2 kernel:  cache: parent cpu3 should not be sleeping
Jun 05 10:09:11 XperiaXA2 kernel: CPU3 is up
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:6][2296261720582] [10:09:11.759069]  wlan: [3690:I :HDD] __wlan_hdd_bus_resume_noirq: 943: starting bus_resume_noirq
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:6][2296261720859] [10:09:11.759082]  wlan: [3690:I :HDD] __wlan_hdd_bus_resume_noirq: 968: bus_resume_noirq done
Jun 05 10:09:11 XperiaXA2 kernel: PM: noirq resume of devices complete after 2.302 msecs
Jun 05 10:09:11 XperiaXA2 kernel: PM: early resume of devices complete after 4.830 msecs
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:6][2296261892495] [10:09:11.768022]  wlan: [3690:I :HDD] __wlan_hdd_bus_resume: 855: starting bus resume
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:6][2296261892927] [10:09:11.768044]  wlan: [3690:I :HIF] hif_snoc_setup_wakeup_sources: expecting wake from ce 2, irq 152 enable 0
Jun 05 10:09:11 XperiaXA2 kernel: R0: [soft_irq][2296262086690] [10:09:11.778135]  wlan: [0:F :WMA] Non-WLAN triggered wakeup: UNSPECIFIED (-1)
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:6][2296262092217] [10:09:11.778423]  wlan: [3690:I :HDD] __wlan_hdd_bus_resume: 904: bus resume succeeded
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:8][2296262093776] [10:09:11.778504]  wlan: [22958:I :HDD] hdd_resume_wlan: 1354: WLAN being resumed by OS
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:8][2296262094085] [10:09:11.778521]  wlan: [22958:I :HDD] hdd_resume_wlan: 1379: Enabling queues for dev mode QDF_STA_MODE
Jun 05 10:09:11 XperiaXA2 kernel: R0: [kworker/u16:8][2296262095850] [10:09:11.778612]  wlan: [22958:I :HDD] hdd_resume_wlan: 1379: Enabling queues for dev mode QDF_P2P_DEVICE_MODE
Jun 05 10:09:11 XperiaXA2 kernel: FG: fg_get_time_to_full_locked: battery profile is not loaded
Jun 05 10:09:11 XperiaXA2 kernel: FG: ttf_work: failed to get ttf, rc=-61
Jun 05 10:09:11 XperiaXA2 kernel: PM: resume of devices complete after 15.259 msecs
Jun 05 10:09:11 XperiaXA2 kernel: Restarting tasks ...

journalctl -f output
dmesg output

edit: oops, I did not see all the discussion and analysis that already happened around this.

Has simply restarting these services already been discussed?