Why add the general notification queue and its sources
Linus Torvalds
torvalds at linux-foundation.org
Thu Sep 5 22:08:42 UTC 2019
On Thu, Sep 5, 2019 at 2:32 PM David Howells <dhowells at redhat.com> wrote:
>
> (1) /dev/watch_queue just implements locked-in-memory buffers. It gets you
> no events by simply opening it.
Cool. In-memory buffers.
But I know - we *have* one of those. There's already a system call for
it, and has been forever. One that we then extended to allow people to
change the buffer size, and do a lot of other things with.
It's called "pipe()". And you can give the writing side to other user
space processes too, in case you are running an older kernel that
didn't have some "event pipe support". It comes with resource
management, because people already use those things.
If you want to make a message protocol on top of it, it has cool
atomicity guarantees for any message size less than PIPE_BUF, but to
make things simple, maybe just say "fixed record sizes of 64 bytes" or
something like that for events.
Then you can use them from things like perl scripts, not just magical
C programs.
Why do we need a new kind of super-fancy high-speed thing for event reporting?
If you have *so* many events that pipe handling is a performance
issue, you have something seriously wrong going on.
So no. I'm not interested in a magical memory-mapped pipe that is
actually more limited than the real thing.
Linus
More information about the Linux-security-module-archive
mailing list