New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression Since 2.7.6: 100% CPU Usage due to an uevent loop when MMP (Multiple Mount Protection) is Enabled #946
Comments
Interesting issue. UDisks itself has an iscsi module based on downstream Can you check |
Thanks for a quick response. Here is the output from the diagnosis tools. I redacted the parts that looked sensitive. Please feel free to request additional info if something is missing: udiskctl monitor
journalctl
udiskctl dump
lsblk -O
|
Here are some details about the target machine: uname -a
The disk is partitioned with a normal ext4 fs. There is something special: the disk is also accessible on the target system via a loopback interface for backups. I tried removing it from the loopback pool but it didn't solve the issue. |
Logging out from the desktop session didn't change anything. As long as the systemd service is running, iptraf is showing a lot of traffic on the network (as much as the channel allows). I tried to access the disk in a virtual machine. It works without any issues on a minimal fedora without any desktop, but there is also no udisks2 installed. As mentioned the same issue is observed on Manjaro 21.2.0 XFCE. I tried to connect the target machine to a different router. Didn't change the behaviour. |
Thanks for the outputs. I don't see anything unusual, just tried to reproduce your scenario here, with an unpartitioned ext4-formatted iscsi volume and everything works as expected. Target is my Gentoo host with targetcli, initiator is F35 with a development udisks version (that is very close to 2.9.4 release anyway). No extra traffic observed, tried mounting via udisks. So you're saying that you see constant flow of I'm kinda out of ideas here, the next step would be debugging |
Another possibility is attaching |
I went a different path and placed the drive into a different machine with ubuntu server (it has udisks2 installed). Immediately after the boot I noticed 100% CPU usage caused by an uevent loop, which was happening only for two partitions out of five. Those are the exact partitions I was using with iSCSI. To avoid multiple mounts on those partitions, which is possible with iSCSI, but leads to data corruption, I enabled MMP (Multiple Mount Protection) in the past. This is exactly what is driving udev crazy, for some reason. Disabling this feature on those partitions resolved the issue! So I am pretty certain this is the root cause (renaming this github issue). Here are the commands I had to execute to resolve:
To check whether MMP is enabled, one could use:
So the workaround for me was disabling MMP for now. But I am not keen to keep it disabled for a long time because it could lead to fs corruption and data loss if the partition is mounted by two iSCSI initiators at the same time by accident. PS: funny enough, when Googling for "mmp ext4", this is the first search result I get: https://unix.stackexchange.com/questions/663211/systemd-udev-high-cpu-via-systemd-udevd-because-of-mmp-ext4-feature |
Oh, nice, good shot! The real problem is that Reproduced on a simple local block device, no need for iscsi. Anyway, I can only imagine a workaround would need to be placed in udisks. However we've had issues with calling the filesystem introspection tools in the past and I would personally would like to get rid of such calls completely: udisks/src/udiskslinuxfilesystem.c Lines 147 to 202 in 9b39fe8
|
Ah, great that you were able to narrow it down to the specific code lines! Maybe it helps somehow that this issue did not exist in 2.7.5? Apparently something was done differently back then, not sure though whether the same code can be used still. 2.9.4 probably diverged quite a bit from 2.7.5. |
It was added on purpose, however nobody expected such consequences back then: #477 |
Definitely time to change this to a function instead of property (or make the property invalid until a function is called to refresh it?). |
I'm generally trying to keep the public API as stable as possible but I'm out of ideas here. A while back I tried to hack the GDBus machinery to hook interface property retrieval and make it on demand but failed horribly. Support for this would need to be added to Sure this can be made a function instead, marking the property as deprecated (and perhaps only valid when the filesystem is mounted, retrieved by other means). @mvollmer ? As for the |
Nope, returns static memory, any write would segfault. However!... |
Yes, but this is read-only access. And we are not mounting the device for |
Hello udisks maintainers! Thank you for all the hard work maintaing this beautiful package and developing new features.
Upon logging into an iSCSI target with
iscsiadm --mode node --targetname [REDACTED] --login
I observe that my network is maxed and the CPU usage is very high.udevadm monitor
is showing a constant stream of change events.After a lot of digging and with some luck, I was able to narrow the issue down to udisks2. The spamming stops once I log out from the target or stop the udisks systemd service. Here is some information about my system:
I am using the KDE spin of fc35. Also reproduced the same behavior on Manjaro XFCE.
Downgrading to 2.7.5 resolves the issue, so I suppose it was introduced in 2.7.6. Is there some better workaround or some config I have to apply to fix this issue?
The text was updated successfully, but these errors were encountered: