[systemd-devel] [RFC][PATCH] udev: add exclusive event filter

WaLyong Cho walyong.cho at samsung.com
Sun Nov 10 23:12:43 PST 2013


Previously, ignore_device option had existed until udev 147. But that
was removed after below commit.

cdae488a3fbca5a61b3f8ea0651730cfa2da9cb0

remove "ignore_device"
There is no way to ignore an event these days. Libudev events can
not be suppressed. It only prevents RUN keys from being executed,
which results in an inconsistent behavior in current setups.

http://cgit.freedesktop.org/systemd/systemd/commit/?id=cdae488a3fbca5a61b3f8ea0651730cfa2da9cb0


In mobile(maybe also embedded) world, power and memory management are
big issue. That can not be compromised. If there are no tasks who
receive such uevents from udev monitor(not kernel monitor) then the
uevents are useless. Each uevent will may cause each fork() if there is
no idle worker.

In our system, there is a special daemon who directly linked with kernel
monitor. (That is similar with system server of android.) He receive
event data from kernel monitor. And some of events are only treated by
him. Especially, backlight and power_supply(battery) events are. In
every change state of LCD, backlight events were occurred. In desktop
environment, this event may be occurred one or twice per hour. (Sure, it
can configurable.) And, in every battery percentage changing,
power_supply events were happen. (I couldn't see this on my fedora when
using ac-power. I'm not sure it because of full charged stated.) Anyway,
both of them are more frequently happen in mobile world.
In our worst case, a uevent(a kind of thermistor) was happen each 10
second. If udev is in idle state, udev will fork to process that event.
After processing(may be 3 sec), the worker will be terminated. There are
no workers during 7 seconds. And worker will be forked again by the uevent.
Yeah, it is a terrible repetition of our system.

I want to skip this kind of events just after retrieving from netlink
without worker fork.
This patch will filter-out(I could not find suitable vocabulary because
of we already using "filter".) subsystem:devtype events what be listed
in udev.conf. If we want to skip whole of subsystem then subsystem can
only be specified.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-udev-add-exclusive-event-filter.patch
Type: text/x-diff
Size: 16632 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20131111/fbacc817/attachment-0001.patch>


More information about the systemd-devel mailing list