epoll interface change and glibc bits ...
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Mark Mielke <[email protected]> writes:
OTOH, I really hate the "user pointer in struct epollfd" thing...
Are you saying you see no way of using the 'user pointer in struct epollfd' to accelerate event dispatching?
No, I'm saying that's it's a tricky and unusual thing, and I'm not convinced that eliminating an fd array will make a substantial difference, cache or no.
Quoted 4 lines
For a perfectly good example of a use for it that has nothing to do with pointers, consider the possibility that the structure could hold a priority number [...] to sort high priority events before low priority events without having to dereference every single fd?
Sure, but...
Quoted 2 lines
I would even tend to delay executing low priority events until
epoll_wait(0)stopped telling me about high priority events.
...for this to work, you have to stow events over epoll calls. The sensible place to store these is in your per-fd structure. So you still don't save the access to your per-event structure, just the one array index lookup.
If you do priorities, you *must* do this; otherwise you will be processing all events as they arrive in userspace. Merely doing them in priority order will produce a slightly reduced but still O(n) latency for high priority events, rather than roughly bounded latency as is usually the intent.
BTW it is also possible to implement event prioritization in kernelspace. You just [e]poll several sets of epolled fd's and take the most interesting set of events each time. Unless, that is, the new syscall interface broke this...
Quoted 4 lines
An opaque field gives me, the event loop designer, freedom. No opaque field because a few event loop designers are convinced that it will be used as a data pointer, and they believe this to be wrong, is a limitation.
Bah. Freedom causes holes in feet.
Flexible interfaces are invariably a pain for the users or the developers or both. Inflexible interfaces are less painful - they either work or they don't. As long as you avoid the nonworking sort, life is wonderful.
Quoted 2 lines
epoll provides a very efficient alternative to poll. Forcing epoll to look like poll somewhat defeats the purpose. I don't mind having
No argument here; it might even be handy for epoll to do other things, but this hinting feature just feels wrong. (Even "other things" would probably be better implemented through standard poll or some other non-specialized mechanism).
To the coder go the spoils; we'll see what Davide does. And what Linus lets in...
--
Grant Taylor - gtaylor<at>picante.com - http://www.picante.com/~gtaylor/
Linux Printing Website and HOWTO: http://www.linuxprinting.org/
Quoted 7 lines · Grant Taylor
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Mark Mielke <[email protected]> writes:
I would even tend to delay executing low priority events until
epoll_wait(0)stopped telling me about high priority events....for this to work, you have to stow events over epoll calls. The sensible place to store these is in your per-fd structure. So you still don't save the access to your per-event structure, just the one array index lookup.
This isn't necessarily true. For a minimal example a stack or list of undispatched events can be kept. Also, if all high priority events are processed, I would not be so worried about low priority events taking a longer time to be dispatched. Is it not my freedom as an event loop designer to make these decisions?
Quoted 5 lines
If you do priorities, you *must* do this; otherwise you will be processing all events as they arrive in userspace. Merely doing them in priority order will produce a slightly reduced but still O(n) latency for high priority events, rather than roughly bounded latency as is usually the intent.
Overall throughput is not significant. Some events require lower latency than other events. An event loop that assumes that all events should have equal latency may be satisfactory for some applications, but will result in problems for others.
Quoted 4 lines
BTW it is also possible to implement event prioritization in kernelspace. You just [e]poll several sets of epolled fd's and take the most interesting set of events each time. Unless, that is, the new syscall interface broke this...
I'm asking for a little freedom to innovate when the times comes. You are suggesting that I shouldn't have this freedom, and that my ability to innovate should be limited to what you or I can imagine at the current point in time. We're talking about one extra field to a data structure.
I could have asked for epoll to implement a priority scheme internally... I didn't... :-)
mark
Signature · 9 lines
[email protected]/[email protected]/[email protected] __________________________ . . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder |\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | | | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada One ring to rule them all, one ring to find them, one ring to bring them all and in the darkness bind them... http://mark.mielke.cc/
Quoted 2 lines · Grant Taylor
To the coder go the spoils; we'll see what Davide does. And what Linus lets in...
I'm really neutral here, I see pros and cons about the opaque data member. What I should have pretty much decided right now is to go with EPOLL* bits and the "struct epollfd" ( Ulrich request ).
- Davide