I'm running Ubuntu 20.04.5 LTS and using the gnome-classic desktop (because I'm stuck in my ways). I've always noticed a few minutes of high CPU from dbus-daemon when I initially log in, but it always then settles down to an acceptable level. Over the last couple of days, however, dbus-daemon and system-udevd have accounted for a constant 50% of CPU and haven't settled whilst the laptop has been running, causing the fan to run constantly.
I ran dbus-monitor --system
which gave a very fast spooling run of messages, like the excerpt below:
signal time=1676894325.355898 sender=org.freedesktop.DBus -> destination=:1.245 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string ":1.245"
signal time=1676894325.365912 sender=:1.1 -> destination=(null destination) serial=4880989 path=/org/freedesktop/systemd1/unit/sys_2ddevices_2dvirtual_2dblock_2ddm_5cx2d2_2edevice; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.freedesktop.systemd1.Device"
array [
dict entry(
string "SysFSPath"
variant string "/sys/devices/virtual/block/dm-2"
)
]
array [
]
signal time=1676894325.366042 sender=:1.1 -> destination=(null destination) serial=4880990 path=/org/freedesktop/systemd1/unit/sys_2ddevices_2dvirtual_2dblock_2ddm_5cx2d2_2edevice; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.freedesktop.systemd1.Unit"
array [
dict entry(
string "ActiveState"
variant string "active"
)
dict entry(
string "SubState"
variant string "plugged"
)
dict entry(
string "StateChangeTimestamp"
variant uint64 1676892339266329
)
dict entry(
string "StateChangeTimestampMonotonic"
variant uint64 19734942
)
dict entry(
string "InactiveExitTimestamp"
variant uint64 1676892339266329
)
dict entry(
string "InactiveExitTimestampMonotonic"
variant uint64 19734942
)
dict entry(
string "ActiveEnterTimestamp"
variant uint64 1676892339266329
)
dict entry(
string "ActiveEnterTimestampMonotonic"
variant uint64 19734942
)
dict entry(
string "ActiveExitTimestamp"
variant uint64 0
)
dict entry(
string "ActiveExitTimestampMonotonic"
variant uint64 0
)
dict entry(
string "InactiveEnterTimestamp"
variant uint64 0
)
dict entry(
string "InactiveEnterTimestampMonotonic"
variant uint64 0
)
dict entry(
string "Job"
variant struct {
uint32 0
object path "/"
}
)
dict entry(
string "ConditionResult"
variant boolean false
)
dict entry(
string "AssertResult"
variant boolean false
)
dict entry(
string "ConditionTimestamp"
variant uint64 0
)
dict entry(
string "ConditionTimestampMonotonic"
variant uint64 0
)
dict entry(
string "AssertTimestamp"
variant uint64 0
)
dict entry(
string "AssertTimestampMonotonic"
variant uint64 0
)
dict entry(
string "InvocationID"
variant array of bytes [
4c 6f ff 28 3e 58 4e 6e 81 82 b3 1c 0c 83 82 3b
]
)
]
array [
string "Conditions"
string "Asserts"
]
signal time=1676894325.366191 sender=:1.1 -> destination=(null destination) serial=4880991 path=/org/freedesktop/systemd1/unit/dev_2ddm_5cx2d2_2edevice; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.freedesktop.systemd1.Device"
array [
dict entry(
string "SysFSPath"
variant string "/sys/devices/virtual/block/dm-2"
)
]
array [
]
signal time=1676894325.366431 sender=:1.1 -> destination=(null destination) serial=4880992 path=/org/freedesktop/systemd1/unit/dev_2ddm_5cx2d2_2edevice; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.freedesktop.systemd1.Unit"
array [
dict entry(
string "ActiveState"
variant string "active"
)
dict entry(
string "SubState"
variant string "plugged"
)
dict entry(
string "StateChangeTimestamp"
variant uint64 1676892339266328
)
dict entry(
string "StateChangeTimestampMonotonic"
variant uint64 19734941
)
dict entry(
string "InactiveExitTimestamp"
variant uint64 1676892339266328
)
dict entry(
string "InactiveExitTimestampMonotonic"
variant uint64 19734941
)
dict entry(
string "ActiveEnterTimestamp"
variant uint64 1676892339266328
)
dict entry(
string "ActiveEnterTimestampMonotonic"
variant uint64 19734941
)
dict entry(
string "ActiveExitTimestamp"
variant uint64 0
)
dict entry(
string "ActiveExitTimestampMonotonic"
variant uint64 0
)
dict entry(
string "InactiveEnterTimestamp"
variant uint64 0
)
dict entry(
string "InactiveEnterTimestampMonotonic"
variant uint64 0
)
dict entry(
string "Job"
variant struct {
uint32 0
object path "/"
}
)
dict entry(
string "ConditionResult"
variant boolean false
)
dict entry(
string "AssertResult"
variant boolean false
)
dict entry(
string "ConditionTimestamp"
variant uint64 0
)
dict entry(
string "ConditionTimestampMonotonic"
variant uint64 0
)
dict entry(
string "AssertTimestamp"
variant uint64 0
)
dict entry(
string "AssertTimestampMonotonic"
variant uint64 0
)
dict entry(
string "InvocationID"
variant array of bytes [
0c b8 d1 90 42 3e 45 b6 88 f3 71 6e 66 1e 83 c5
]
)
]
array [
string "Conditions"
string "Asserts"
]
Running udevadm monitor
gave a similar, although not quite as fast flow of messages, like this:
KERNEL[2188.932041] change /devices/virtual/block/dm-2 (block)
UDEV [2188.940914] change /devices/virtual/block/dm-2 (block)
KERNEL[2188.945441] change /devices/virtual/block/dm-2 (block)
UDEV [2188.957689] change /devices/virtual/block/dm-2 (block)
KERNEL[2188.961225] change /devices/virtual/block/dm-2 (block)
UDEV [2188.969813] change /devices/virtual/block/dm-2 (block)
KERNEL[2188.974779] change /devices/virtual/block/dm-2 (block)
dm-2
is clearly to blame for some reason. dm-2
is my home partition:
~$ ls -l /dev/mapper/
total 0
crw------- 1 root root 10, 236 Feb 20 11:25 control
lrwxrwxrwx 1 root root 7 Feb 20 12:02 home -> ../dm-2
lrwxrwxrwx 1 root root 7 Feb 20 11:25 sda3_crypt -> ../dm-0
lrwxrwxrwx 1 root root 7 Feb 20 11:25 swap -> ../dm-1
My understanding of dbus and udev is limited to say the least, but a bit of googling lead me to this post which suggested I create a file /etc/udev/rulesd/90-fixdm.rules
which contained
ACTION=="add|change", KERNEL=="dm-*", OPTIONS:="nowatch"
This did indeed instantly calm the two processes and gave me my CPU cycles back (and stopped the laptop fan from constantly running). However, the next day the laptop failed to boot, hanging at a "waiting for /dev/mapper/swap" job that was never starting. One panicked use of a Live-Ubuntu stick to remove the file from /etc/udev/rulesd/90-fixdm.rules
later and I'm back to square one - the laptop boots again, but the high CPU usage from dbus-daemon
and system-udevd
has returned.
What might have changed to cause this new behaviour, and what can I do to remedy the problem?
Thanks.