richardphibel / rpms / systemd

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