Comment 14 for bug 1185394

Revision history for this message
Martin Pitt (pitti) wrote :

Stefan and I debugged and discussed that. The new udev has a reduced number of parallel workers now (performance optimization, see Harald Hoyer's measurements), which potentially leads to more serialization for a huge number of events (as we get in initramfs by calling udevadm trigger). This is one of the relevant changes between 175 and 202, as Stefan pointed out in comment 7.

Our 0024-avoid-exit-deadlock-for-dm_cookie.patch only keeps those workers running which process an uevent with DM_COOKIE. But that doesn't catch the majority of the LVM related events (only the kernel-generated change events on LVs after the virtual->physical mapping has been set up). All the add events, as well as the change events for the other block devices would still go to nirvana (i. e. the time between shutting down udev in initramfs and bringing it back up in the real system).

We tried to trigger a change event for the missing LVs, but that does not work as "vgchange -a y" already has all the /dev/dm-* set up, sees no change, and thus does not cause a proper change event for the LV to be generated. Hence the symlinks aren't created by our /etc/init/udevtrigger.conf job. What does work is to "dmsetup remove" the affected LVs and then call vgchange to re-add them, but finding the affected LVs and doing that for all of them would duplicate a lot of the work which is already happening in initramfs anyway, and thus be rather expensive. It seems much more efficient to me to just do that detection once, and just wait in initramfs until all LVs are complete.

http://people.canonical.com/~pitti/tmp/systemd/ (202-0ubuntu11pitti2) does that approach now: It "udevadm settle"s in udev's initramfs-bottom script IF lvm2 is installed (we could also check for /sys/block/dm-*, but that's racy; we rather err on the side of doing an unnecessary settle), and disables 0024-avoid-exit-deadlock-for-dm_cookie.patch as the settle achieves the same goal in a more complete way.