From 7ee6de6e0dbe9399b839a9c6ed7aff645b1fda68 Mon Sep 17 00:00:00 2001 From: Jichao Zou Date: Sat, 22 Apr 2023 14:47:08 +0000 Subject: [PATCH] init : optimize the performance of boot time. Avoid the unnecessary check to optimize the performance of boot time. Before change: init : Command 'mount_all /vendor/etc/fstab.qcom --late' action=late-fs (/vendor/etc/init/hw/init.target.rc:105) took 1382ms and succeeded after change: init : Command 'mount_all /vendor/etc/fstab.qcom --late' action=late-fs (/vendor/etc/init/hw/init.target.rc:105) took 588ms and succeeded Change-Id: I3177acae7e3080d24fd3ca52e2ad31d86fcda416 --- init/devices.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init/devices.cpp b/init/devices.cpp index d29ffd604..5ec4ce6cb 100644 --- a/init/devices.cpp +++ b/init/devices.cpp @@ -529,6 +529,9 @@ void DeviceHandler::HandleAshmemUevent(const Uevent& uevent) { } void DeviceHandler::HandleUevent(const Uevent& uevent) { + if (!uevent.modalias.empty()) return; + if (uevent.subsystem == "firmware" && uevent.action == "add") return; + if (uevent.action == "add" || uevent.action == "change" || uevent.action == "bind" || uevent.action == "online") { FixupSysPermissions(uevent.path, uevent.subsystem);