Re: PROPOSAL: extend pipe() to support NULL argument.

From: Zan Lynx
Date: Tue Jul 07 2009 - 17:02:50 EST


David Newall wrote:
Changli Gao wrote:
mkfifo(name);
open(name, O_RDWR);
unlink(name);

Is it a trick?

This does beg the question, why is it necessary to "extend" pipe() in
this way?

Well, to me it sounds like the goal of the proposal is for very high load, high performance socket servers so efficiency matters.

The above is more than 3 times as expensive as one pipe(). Each syscall is thousands of machine cycles in overhead. In addition to that all three are VFS operations which as I recall are even more expensive than other syscalls.

But perhaps mkfifo(NULL) should be the syscall chosen to extend since its parameters are much like open() already, and it seems to work in the above sequence to create a one-FD FIFO already.

Or instead of, or in addition to a NULL name argument, its mode argument could be used as a flags argument to specify an anonymous fifo creation with FD return.
--
Zan Lynx
zlynx@xxxxxxx

"Knowledge is Power. Power Corrupts. Study Hard. Be Evil."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/