public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John Gardiner Myers <jgmyers@netscape.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: linux-aio@kvack.org, lse-tech@lists.sourceforge.net
Subject: Re: and nicer too - Re: [PATCH] epoll more scalable than poll
Date: Tue, 29 Oct 2002 18:22:35 -0800	[thread overview]
Message-ID: <3DBF426B.6050208@netscape.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0210291237240.1457-100000@blue1.dev.mcafeelabs.com>

Davide Libenzi wrote:

>You're in the computer science by many many years and still you're not able to
>understand how edge triggered events works.
>
Failure to agree does not imply failure to understand.  I understand the 
model you want to apply to this problem, I do not agree that it is the 
best model to apply to this problem.

>Why the heck ( and this for the 100th time ) do you want to go to wait for
>an event on the newly born fd if :
>
>1) On connect() you have the _full_ write I/O space available
>2) On accept() it's very likely the you'll find something more than a SYN
>	in the first packet
>
>Besides, the first code is even more cleaner and simmetric, while adopting
>your half *ss solution might suggest the user that he can go waiting for
>events any time he wants.
>
The first code is hardly cleaner and is definitely not symmetric--the 
way the accept code has to set up to fall through the do_use_fd() code 
is subtle.  In the first code, the accept segment cannot be cleanly 
pulled into a callback:

for (;;) {
        nfds = sys_epoll_wait(kdpfd, &pfds, -1);
        for(n = 0; n < nfds; ++n) {
                (cb[pfds[n].fd])(pfds[n].fd);
        }
}


Also, your first code does not fit your "edge triggered" model--the code 
for handling 's' does not drain its input.  By the time you call 
accept(), there could be multiple connections ready to be accepted.

Your connect() argument is not applicable to "server sends first" 
protocols.  I suspect you are being overly optimistic about the 
likelihood of getting data with SYN, but whatever.  The argument is 
basically that not delivering an event upon registration (and thus 
having the event be implicit) improves performance because the socket is 
going to be ready with sufficiently high probability.  I would counter 
that the cost of explicitly delivering such an event is miniscule 
compared to the rest of the cost of connection setup and teardown--the 
optimization is not worthwhile.

>Like going to sleep the the wait queue of IDE
>disk w/out having issued any command.
>
The key difference between this interface and wait queues is that with 
wait queues it is not technically feasible to both register interest and 
test the condition in a single, atomic operation.  epoll does not have 
this technical limitation, so it can provide a better interface.

>PS: since my time is not infinite, and since I'm working on the changes we
>agreed with Andrew I would suggest you either to take another look at the
>code suggesting us new changes ( like you did yesterday ) or to go
>shopping for books.
>
I am uncomfortable with the way the epoll code adds its own set of 
notification hooks into the socket and pipe code.  Much better would be 
to extend the existing set of notification hooks, like the aio poll code 
does.  That would reduce the risk of kernel bugs where some subsystem 
fails to deliver an event to one but not all types of poll notification 
hooks and it would minimize the cost of the epoll patch when epoll is 
not being used.

>  
>



  parent reply	other threads:[~2002-10-30  2:16 UTC|newest]

Thread overview: 117+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-28 19:14 [PATCH] epoll more scalable than poll Hanna Linder
2002-10-28 20:10 ` Hanna Linder
2002-10-28 20:56 ` Martin Waitz
2002-10-28 22:02   ` bert hubert
2002-10-28 22:15     ` bert hubert
2002-10-28 22:17   ` Davide Libenzi
2002-10-28 22:08 ` bert hubert
2002-10-28 22:12   ` [Lse-tech] " Shailabh Nagar
2002-10-28 22:37     ` Davide Libenzi
2002-10-28 22:29   ` Davide Libenzi
2002-10-28 22:58     ` and nicer too - " bert hubert
2002-10-28 23:23       ` Davide Libenzi
2002-10-28 23:44     ` Jamie Lokier
2002-10-29  0:02       ` Davide Libenzi
2002-10-29  1:51         ` Jamie Lokier
2002-10-29  5:06           ` Davide Libenzi
2002-10-29 11:20             ` Jamie Lokier
2002-10-30  0:16               ` Davide Libenzi
2002-10-29  0:03       ` bert hubert
2002-10-29  0:20         ` Davide Libenzi
2002-10-29  0:48         ` Jamie Lokier
2002-10-29  1:53           ` Jamie Lokier
2002-10-28 23:45   ` and nicer too - " John Gardiner Myers
2002-10-29  0:08     ` Davide Libenzi
2002-10-29 12:59       ` Martin Waitz
2002-10-29 15:19         ` bert hubert
2002-10-29 22:54           ` Martin Waitz
2002-10-30  2:24             ` Davide Libenzi
2002-10-30 19:38               ` Martin Waitz
2002-10-31  5:04                 ` Davide Libenzi
2002-10-29  0:18     ` bert hubert
2002-10-29  0:32       ` Davide Libenzi
2002-10-29  0:40         ` bert hubert
2002-10-29  0:57           ` Davide Libenzi
2002-10-29  0:53             ` bert hubert
2002-10-29  1:13               ` Davide Libenzi
2002-10-29  1:08                 ` [Lse-tech] " Hanna Linder
2002-10-29  1:39                   ` Davide Libenzi
2002-10-29  2:05               ` Jamie Lokier
2002-10-29  2:44                 ` Davide Libenzi
2002-10-29  4:01                   ` [PATCH] Updated sys_epoll now with man pages Hanna Linder
2002-10-29  5:09                     ` Andrew Morton
2002-10-29  5:28                       ` [Lse-tech] " Randy.Dunlap
2002-10-29  5:47                         ` Davide Libenzi
2002-10-29  5:41                           ` Randy.Dunlap
2002-10-29  6:12                             ` Davide Libenzi
2002-10-29  6:03                               ` Randy.Dunlap
2002-10-29  6:23                                 ` Davide Libenzi
2002-10-29 14:59                         ` Paul Larson
2002-10-29  5:31                       ` Davide Libenzi
2002-10-29  7:34                       ` Davide Libenzi
2002-10-29 11:04                       ` bert hubert
2002-10-29 15:30                       ` [Lse-tech] " Shailabh Nagar
2002-10-29 17:45                         ` Davide Libenzi
2002-10-29 19:30                           ` Hanna Linder
2002-10-29 19:49                             ` Davide Libenzi
2002-10-29 13:09             ` and nicer too - Re: [PATCH] epoll more scalable than poll bert hubert
2002-10-29 21:25               ` Davide Libenzi
2002-10-29 21:23                 ` Hanna Linder
2002-10-29 21:41                   ` Davide Libenzi
2002-10-29 23:06                     ` Hanna Linder
2002-10-29 23:14                       ` [Lse-tech] " Randy.Dunlap
2002-10-29 23:25                       ` Davide Libenzi
2002-10-29  1:47   ` Security critical race condition in epoll code John Gardiner Myers
2002-10-29  2:13     ` Davide Libenzi
2002-10-29  3:38     ` Davide Libenzi
2002-10-29 19:49   ` and nicer too - Re: [PATCH] epoll more scalable than poll John Gardiner Myers
2002-10-29 21:03     ` Davide Libenzi
2002-10-30  0:26       ` Jamie Lokier
2002-10-30  2:09         ` Davide Libenzi
2002-10-30  5:51         ` Davide Libenzi
2002-10-30  2:22       ` John Gardiner Myers [this message]
2002-10-30  3:51         ` Davide Libenzi
2002-10-31  2:07           ` John Gardiner Myers
2002-10-31  3:21             ` Davide Libenzi
2002-10-31 11:10               ` [Lse-tech] " Suparna Bhattacharya
2002-10-31 18:42                 ` Davide Libenzi
2002-10-30 23:01         ` Jamie Lokier
2002-10-30 23:53           ` Davide Libenzi
2002-10-31  0:52             ` Jamie Lokier
2002-10-31  4:15               ` Davide Libenzi
2002-10-31 15:07                 ` Jamie Lokier
2002-10-31 19:10                   ` Davide Libenzi
2002-11-01 17:42                     ` Dan Kegel
2002-11-01 17:45                       ` Davide Libenzi
2002-11-01 18:41                         ` Dan Kegel
2002-11-01 19:16                       ` Jamie Lokier
2002-11-01 20:04                         ` Charlie Krasic
2002-11-01 20:14                           ` Jamie Lokier
2002-11-01 20:22                         ` Mark Mielke
2002-10-31 15:41                 ` Unifying epoll,aio,futexes etc. (What I really want from epoll) Jamie Lokier
2002-10-31 15:48                   ` bert hubert
2002-10-31 16:45                   ` Alan Cox
2002-10-31 22:00                     ` Rusty Russell
2002-11-01  0:32                       ` Jamie Lokier
2002-11-01 13:23                       ` Alan Cox
2002-10-31 20:28                   ` Davide Libenzi
2002-10-31 23:02                     ` Jamie Lokier
2002-11-01  1:01                       ` Davide Libenzi
2002-11-01  2:01                         ` Jamie Lokier
2002-11-01 17:36                           ` Davide Libenzi
2002-11-01 20:45                         ` Jamie Lokier
2002-11-01  1:55                       ` Matthew D. Hall
2002-11-01  2:54                         ` Davide Libenzi
2002-11-01 18:18                           ` Dan Kegel
2002-11-01  2:56                         ` Jamie Lokier
2002-11-01  4:29                       ` Mark Mielke
2002-11-01  4:59                         ` Jamie Lokier
2002-11-01 23:27                       ` John Gardiner Myers
2002-11-02  4:55                         ` Mark Mielke
2002-11-02 15:41                         ` Jamie Lokier
2002-11-05 18:15                       ` pipe POLLOUT oddity John Gardiner Myers
2002-11-05 18:18                         ` Benjamin LaHaise
2002-11-01 23:16                   ` Unifying epoll,aio,futexes etc. (What I really want from epoll) John Gardiner Myers
2002-10-30 18:59       ` and nicer too - Re: [PATCH] epoll more scalable than poll Zach Brown
2002-10-30 19:25         ` Davide Libenzi
2002-10-31 16:54         ` Davide Libenzi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DBF426B.6050208@netscape.com \
    --to=jgmyers@netscape.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lse-tech@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox