]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
device: don't emit PropetiesChanged needlessly 15233/head
authorMichal Sekletár <msekleta@redhat.com>
Thu, 26 Mar 2020 12:35:11 +0000 (13:35 +0100)
committerMichal Sekletár <msekleta@redhat.com>
Sat, 28 Mar 2020 20:26:40 +0000 (21:26 +0100)
Functions called from device_setup_unit() already make sure that unit is
enqueued in case it is a new unit or properties exported on the bus have
changed.

This should prevent unnecessary DBus wakeups and associated DBus traffic
when device_setup_unit() was called while reparsing /proc/self/mountinfo
due to the mountinfo notifications. Note that we parse
/proc/self/mountinfo quite often on the busy systems (e.g. k8s container
hosts) but majority of the time mounts didn't change, only some mount
got added. Thus we don't need to generate PropertiesChanged for devices
associated with the mounts that didn't change.

Thanks to Renaud Métrich <rmetrich@redhat.com> for debugging the
problem and providing draft version of the patch.

src/core/device.c

index 03bfd9b329dcc8faee7dea3248db6f29e9d11169..8e00fd3df6e546c135a5e6aa045a7384e59eb225 100644 (file)
@@ -564,9 +564,6 @@ static int device_setup_unit(Manager *m, sd_device *dev, const char *path, bool
         if (dev && device_is_bound_by_mounts(DEVICE(u), dev))
                 device_upgrade_mount_deps(u);
 
-        /* Note that this won't dispatch the load queue, the caller has to do that if needed and appropriate */
-        unit_add_to_dbus_queue(u);
-
         return 0;
 
 fail: