public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] /dev/epoll update ...
@ 2001-09-24  4:16 Dan Kegel
  2001-09-24 19:11 ` Eric W. Biederman
       [not found] ` <3BAF83EF.C8018E45@distributopia.com>
  0 siblings, 2 replies; 51+ messages in thread
From: Dan Kegel @ 2001-09-24  4:16 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org, Gordon Oliver

Gordon Oliver <gordo@pincoya.com> wrote:
> But you missed the obvious optimization of doing an f_ops->poll when
> the file is _added_. This means that you'll get an initial event when
> there is data ready. ...

Note that you can do that in userspace by calling poll(), btw.  That
gets you down to a single extra system call initially.

> Note that it has the additional advantage of making the dispatch code
> in the user application easier. You no longer have to do special code
> to handle the speculative read after adding the fd.

As Davide points out in his reply, /dev/epoll is an exact clone of
the O_SETSIG/O_SETOWN/O_ASYNC realtime signal way of getting readiness
change events, but using a memory-mapped buffer instead of signal delivery
(and obeying an interest mask).  Unlike /dev/poll, it only provides
information about *changes* in readiness.

Everyone who has successfully written code using the O_SETSIG/O_SETOWN/O_ASYNC
code knows that it does not send an initial state event.  This has not
gotten in the way, as a rule.

If it does turn out to be Very Important for these single-shot readiness
notification schemes to generate synthetic initial readiness events,
it should be added both to /dev/epoll and to O_SETSIG/O_SETOWN/O_ASYNC.

I think there is still some confusion out there because of the name
Davide chose; /dev/epoll is so close to /dev/poll that it lulls many
people (myself included) into thinking it's a very similar thing.  It ain't.
(I really have to fix my c10k page to reflect that correctly...)
- Dan

^ permalink raw reply	[flat|nested] 51+ messages in thread
* [patch] /dev/epoll update ...
@ 2002-03-20  3:49 Davide Libenzi
  0 siblings, 0 replies; 51+ messages in thread
From: Davide Libenzi @ 2002-03-20  3:49 UTC (permalink / raw)
  To: Linux Kernel Mailing List


*) Export correct symbols from fcblist.c so eventpoll can be used
	as a module ( thx to  Paul P Komkoff Jr  )
*) Added GPL modlicense to eventpoll.c ( thx to  Paul P Komkoff Jr  )
*) Added timeout unsigned long overflow check ( thx to  Ossama Othman  )


http://www.xmailserver.org/linux-patches/nio-improve.html#patches




- Davide







^ permalink raw reply	[flat|nested] 51+ messages in thread
[parent not found: <local.mail.linux-kernel/3BB03C6A.7D1DD7B3@kegel.com>]
* Re: [PATCH] /dev/epoll update ...
@ 2001-09-21  6:22 Dan Kegel
  2001-09-21 18:45 ` Davide Libenzi
  0 siblings, 1 reply; 51+ 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] 51+ messages in thread
* re: [PATCH] /dev/epoll update ...
@ 2001-09-19  2:20 Dan Kegel
  2001-09-19  6:25 ` Dan Kegel
                   ` (2 more replies)
  0 siblings, 3 replies; 51+ messages in thread
From: Dan Kegel @ 2001-09-19  2:20 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org, Davide Libenzi

Davide wrote:

> The /dev/epoll patch has been updated :
> 
> *) Stale events removal
> *) Help in Configure.help ( thanks to David E. Weekly )
> *) Fit 2.4.9
> ...
> http://www.xmailserver.org/linux-patches/nio-improve.html

Davide, 
I'm getting ready to stress-test /dev/epoll finally.
In porting my Poller_devpoll.{cc,h} to support /dev/epoll, I noticed
the following issues:

1. it would be very nice to be able to expand the interest list
   without affecting the currently ready list.  In fact, this may
   be needed to support existing programs.    A quick look at
   your code gives me the impression that it would be easy to add
   a ioctl(kdpfd, EP_REALLOC, newmaxfds) call to do this.  Do you agree?

2. The names made visible to userland by your patch do not follow
   a consistent naming convention.  May I suggest that you use
   EPOLL_ as a uniform prefix, and epoll.h as the user-visible include file?
   http://www.opengroup.org/onlinepubs/007908799/xsh/compilation.html
   shows that Posix cares greatly about this kind of namespace issue,
   and it'd be nice to follow their lead, even though this isn't a Posix
   interface.

3. You modify asm/poll.h.  Can your modifications be restricted to epoll.h 
   instead?  (Hey, I don't know much, maybe there's a good reason you did this.)

Thanks,
Dan Kegel

^ permalink raw reply	[flat|nested] 51+ messages in thread
* [PATCH] /dev/epoll update ...
@ 2001-09-07 19:27 Davide Libenzi
  0 siblings, 0 replies; 51+ messages in thread
From: Davide Libenzi @ 2001-09-07 19:27 UTC (permalink / raw)
  To: lkml


The /dev/epoll patch has been updated :

*) Stale events removal
*) Help in Configure.help ( thanks to David E. Weekly )
*) Fit 2.4.9

This is the link :

http://www.xmailserver.org/linux-patches/nio-improve.html




- Davide


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

end of thread, other threads:[~2002-03-20  3:44 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-24  4:16 [PATCH] /dev/epoll update Dan Kegel
2001-09-24 19:11 ` Eric W. Biederman
2001-09-24 19:34   ` Jamie Lokier
2001-09-24 20:09     ` Davide Libenzi
2001-09-24 21:56       ` Jamie Lokier
2001-09-24 22:08         ` Davide Libenzi
2001-09-24 22:09           ` Jamie Lokier
2001-09-24 22:20             ` Davide Libenzi
2001-09-24 22:21               ` Jamie Lokier
2001-09-24 22:30                 ` Davide Libenzi
2001-09-25  9:25             ` Dan Kegel
     [not found] ` <3BAF83EF.C8018E45@distributopia.com>
2001-09-25  8:12   ` Dan Kegel
  -- strict thread matches above, loose matches on Subject: below --
2002-03-20  3:49 [patch] " Davide Libenzi
     [not found] <local.mail.linux-kernel/3BB03C6A.7D1DD7B3@kegel.com>
     [not found] ` <local.mail.linux-kernel/3BAEB39B.DE7932CF@kegel.com>
     [not found]   ` <local.mail.linux-kernel/3BAF83EF.C8018E45@distributopia.com>
2001-09-25 17:36     ` [PATCH] " Jonathan Lemon
2001-09-25 18:34       ` Dan Kegel
2001-09-21  6:22 Dan Kegel
2001-09-21 18:45 ` Davide Libenzi
2001-09-19  2:20 Dan Kegel
2001-09-19  6:25 ` Dan Kegel
2001-09-19  7:04 ` Christopher K. St. John
2001-09-19 15:37   ` Dan Kegel
2001-09-19 15:59     ` Zach Brown
2001-09-19 17:12     ` Christopher K. St. John
2001-09-19 17:39     ` Davide Libenzi
2001-09-19 18:26     ` Alan Cox
2001-09-19 17:25   ` Davide Libenzi
2001-09-19 19:03     ` Christopher K. St. John
2001-09-19 19:30       ` Davide Libenzi
2001-09-19 21:49         ` Christopher K. St. John
2001-09-19 22:11           ` Davide Libenzi
2001-09-19 23:24             ` Christopher K. St. John
2001-09-19 23:52               ` Davide Libenzi
2001-09-20  2:13             ` Dan Kegel
2001-09-20  2:28               ` Davide Libenzi
2001-09-20  3:03                 ` Dan Kegel
2001-09-20 16:58                   ` Davide Libenzi
2001-09-20  4:32                 ` Christopher K. St. John
2001-09-20  4:43                   ` Christopher K. St. John
2001-09-20  5:05                     ` Benjamin LaHaise
2001-09-20 18:25                       ` Davide Libenzi
2001-09-20 19:33                         ` Benjamin LaHaise
2001-09-20 19:58                           ` Davide Libenzi
2001-09-20 17:18                   ` Davide Libenzi
2001-09-24  0:11                     ` Gordon Oliver
2001-09-24  0:33                       ` Davide Libenzi
2001-09-24 19:23                     ` Eric W. Biederman
2001-09-24 20:04                       ` Davide Libenzi
2001-09-21  5:59             ` Ton Hospel
2001-09-21 16:48               ` Davide Libenzi
2001-09-19 17:21 ` Davide Libenzi
2001-09-07 19:27 Davide Libenzi

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