[RFC] Proof-of-concept for netlink listener for mdev -i
Harald Becker
ralda at gmx.de
Fri Mar 20 22:19:13 UTC 2015
On 20.03.2015 21:28, V.Krishn wrote:
> The concept of a simple netlink reader daemon seems nice.
> But would seem extra to having another reader that reads this reader.
> The concept of whole /sys tree is being re-done, even if its just not
> visible(memory). I could add/suggest few changes.
> Please consider concept/flow below as theoretical.
1) Your question is about the principal of putting all together in one
logical process, or splitting operation into different threads. Most
likely will modern multi core processors benefit from splitting into
threads, as those may run on different cpu cores, but also single core
machines shall gain benefit, as the pipe has buffering purposes and
allow for more parallel operation.
2) The pipe is pure memory operation, which will never access any
physical disk, so we do memory writes, even faster than writing anything
into /sys/...
3) The reader is started on demand, that is this process is fired up
only when events arrive and it shall exit, when idle. So the bigger part
drops it's resources giving more to the system for other operation. Only
the small netlink reader part stays in memory.
4) Putting small, functional simple operations together in a pipe, is
the Unix way. netlink is a long lived daemon, but concentrating on it's
single job, to read from netlink, reformat the messages into textual
format, then write them to stdout, make it more compatible to the Unix
philosophy (IMO). And it make this piece of software even compatible
with other textual Unix tools, which can give extra benefit, when you
like to do need things, like display all incoming event messages on a
console.
--
Harald
More information about the busybox
mailing list