public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] /dev/epoll update ...
@ 2001-09-21  6:22 Dan Kegel
  2001-09-21 18:45 ` Davide Libenzi
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Kegel @ 2001-09-21  6:22 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org, Davide Libenzi

Davide wrote:
> If you need to request the current status of 
> a socket you've to f_ops->poll the fd.
> The cost of the extra read, done only for fds that are not "ready", is nothing
> compared to the cost of a linear scan with HUGE numbers of fds.

Hey, wait a sec, Davide... the whole point of the Solaris /dev/poll
is that you *don't* need to f_ops->poll the fd, I think.
And in fact, Solaris /dev/poll is insanely fast, way faster than O(N).

Consider this: what if we added to your patch logic to clear
the current read readiness bit for a fd whenever a read() on
that fd returned EWOULDBLOCK?  Then we're real close to having
the current readiness state for each fd, as the /dev/poll afficianados 
want.  Now, there's a lot more work that'd be needed, but maybe you
get the idea of where some of us are coming from.

Christopher K. St. John is requesting example code using /dev/epoll
that does not use coroutines.  Fair enough.  Christopher, take a look
at any program that uses the F_SETSIG/F_SETOWN/O_ASYNC/sigio stuff in the
2.4 kernel (for example, my Poller_sigio.cc at http://www.kegel.com/dkftpbench/dkftpbench-0.31.tar.gz )
and mentally replace the sigtimedwait() with Davide's ioctl, kinda.
The overhead of not knowing the initial poll state is at most one
or two system calls per fd over the life of the program, I think,
so it's not too bad.

- Dan

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-09-21 21:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-21  6:22 [PATCH] /dev/epoll update Dan Kegel
2001-09-21 18:45 ` Davide Libenzi
2001-09-21 19:40   ` /dev/yapoll : " Christopher K. St. John
2001-09-21 20:10     ` Davide Libenzi
2001-09-21 20:21       ` Christopher K. St. John
2001-09-21 21:36         ` Davide Libenzi
2001-09-21 21:33           ` Christopher K. St. John
2001-09-21 21:52             ` Davide Libenzi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox