bd1529
From a4cefc9f8bf24b2fdcc62cc0d2685698814374d4 Mon Sep 17 00:00:00 2001
bd1529
From: =?UTF-8?q?Michal=20Sekleta=CC=81r?= <msekleta@redhat.com>
bd1529
Date: Thu, 26 Mar 2020 13:35:11 +0100
bd1529
Subject: [PATCH] device: don't emit PropetiesChanged needlessly
bd1529
MIME-Version: 1.0
bd1529
Content-Type: text/plain; charset=UTF-8
bd1529
Content-Transfer-Encoding: 8bit
bd1529
bd1529
Functions called from device_setup_unit() already make sure that unit is
bd1529
enqueued in case it is a new unit or properties exported on the bus have
bd1529
changed.
bd1529
bd1529
This should prevent unnecessary DBus wakeups and associated DBus traffic
bd1529
when device_setup_unit() was called while reparsing /proc/self/mountinfo
bd1529
due to the mountinfo notifications. Note that we parse
bd1529
/proc/self/mountinfo quite often on the busy systems (e.g. k8s container
bd1529
hosts) but majority of the time mounts didn't change, only some mount
bd1529
got added. Thus we don't need to generate PropertiesChanged for devices
bd1529
associated with the mounts that didn't change.
bd1529
bd1529
Thanks to Renaud Métrich <rmetrich@redhat.com> for debugging the
bd1529
problem and providing draft version of the patch.
bd1529
bd1529
(cherry picked from commit 2e129d5d6bd6bd8be4b5359e81a880cbf72a44b8)
bd1529
bd1529
Resolves: #1793533
bd1529
---
bd1529
 src/core/device.c | 3 ---
bd1529
 1 file changed, 3 deletions(-)
bd1529
bd1529
diff --git a/src/core/device.c b/src/core/device.c
bd1529
index 21fe3802bd..021c28dfbd 100644
bd1529
--- a/src/core/device.c
bd1529
+++ b/src/core/device.c
bd1529
@@ -549,9 +549,6 @@ static int device_setup_unit(Manager *m, struct udev_device *dev, const char *pa
bd1529
         if (dev && device_is_bound_by_mounts(DEVICE(u), dev))
bd1529
                 device_upgrade_mount_deps(u);
bd1529
 
bd1529
-        /* Note that this won't dispatch the load queue, the caller has to do that if needed and appropriate */
bd1529
-        unit_add_to_dbus_queue(u);
bd1529
-
bd1529
         return 0;
bd1529
 
bd1529
 fail: