dryang / rpms / systemd

Forked from rpms/systemd a year ago
Clone
149adf
From 47f260a680046d3f9244fffa1ea978041811bf6a Mon Sep 17 00:00:00 2001
149adf
From: Michal Sekletar <msekleta@redhat.com>
149adf
Date: Fri, 24 Jul 2020 17:45:48 +0200
149adf
Subject: [PATCH] device: don't emit PropetiesChanged needlessly
149adf
MIME-Version: 1.0
149adf
Content-Type: text/plain; charset=UTF-8
149adf
Content-Transfer-Encoding: 8bit
149adf
149adf
Functions called from device_setup_unit() already make sure that unit is
149adf
enqueued in case it is a new unit or properties exported on the bus have
149adf
changed.
149adf
149adf
This should prevent unnecessary DBus wakeups and associated DBus traffic
149adf
when device_setup_unit() was called while reparsing /proc/self/mountinfo
149adf
due to the mountinfo notifications. Note that we parse
149adf
/proc/self/mountinfo quite often on the busy systems (e.g. k8s container
149adf
hosts) but majority of the time mounts didn't change, only some mount
149adf
got added. Thus we don't need to generate PropertiesChanged for devices
149adf
associated with the mounts that didn't change.
149adf
149adf
Thanks to Renaud Métrich <rmetrich@redhat.com> for debugging the
149adf
problem and providing draft version of the patch.
149adf
149adf
(cherry-picked from commit 2e129d5d6bd6bd8be4b5359e81a880cbf72a44b8)
149adf
149adf
Resolves: #1793527
149adf
---
149adf
 src/core/device.c | 4 ----
149adf
 1 file changed, 4 deletions(-)
149adf
149adf
diff --git a/src/core/device.c b/src/core/device.c
149adf
index 23c8ee356f..112b28e21f 100644
149adf
--- a/src/core/device.c
149adf
+++ b/src/core/device.c
149adf
@@ -362,10 +362,6 @@ static int device_setup_unit(Manager *m, struct udev_device *dev, const char *pa
149adf
         if (main)
149adf
                 (void) device_add_udev_wants(u, dev);
149adf
 
149adf
-        /* Note that this won't dispatch the load queue, the caller
149adf
-         * has to do that if needed and appropriate */
149adf
-
149adf
-        unit_add_to_dbus_queue(u);
149adf
         return 0;
149adf
 
149adf
 fail: