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

Kay Sievers kay at vrfy.org
Mon Nov 11 05:43:01 PST 2013


On Mon, Nov 11, 2013 at 8:12 AM, WaLyong Cho <walyong.cho at samsung.com> wrote:
> 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.

Please fix your kernel, driver, subsystem instead. Uevents were never
meant to carry higher-frequent events, it's justy not what they should
be used for.

And udev is not meant to filter or suppress any events from the
kernel, it's too late in the game, and people will only mis-use things
here, to paper-over broken kernel drivers. Upstream udev better does
not want to provide such a facility.

Thanks,
Kay


More information about the systemd-devel mailing list