All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Antill <james@and.org>
To: "David Schwartz" <davids@webmaster.com>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [Patch][RFC] epoll and half closed TCP connections
Date: 15 Jul 2003 22:09:06 -0400	[thread overview]
Message-ID: <m3ptkb2pfh.fsf@code.and.org> (raw)
In-Reply-To: <MDEHLPKNGKAHNMBLJOLKIEFBEGAA.davids@webmaster.com>

"David Schwartz" <davids@webmaster.com> writes:

> > "David Schwartz" <davids@webmaster.com> writes:
> 
> > > 	This is really just due to bad coding in 'poll', or more
> > > precisely very bad
> > > for this case. For example, why is it allocating a wait queue
> > > buffer if the
> > > odds that it will need to wait are basically zero? Why is it adding file
> > > descriptors to the wait queue before it has determined that it needs to
> > > wait?
> 
> > Because this is much easier to do in userspace, it's just not very
> > well documented that you should almost always call poll() with a zero
> > timeout first.
> 
> 	It's neither easier to do nor harder, it's basically the same code in
> either place. However, doing it in kernel space saves the extra user/kernel
> transition, poll set allocations, and copies across the u/k boundary in the
> case where we do actually need to wait.

 Optimizing for the waiting case doesn't sound like the right
approach, IMO. And all things being equal, doing it outside the kernel
rules.
 Plus it's possible that someone could come up with a case where you
don't want to do it.

> > However it's been there for years, and things have used
> > it[1].
> 
> 	The thing is, for some reason it (it being the cost of calling poll with a
> constant timeout for 1,024 file descriptors) is exceptionally bad on Linux.
> Worse than every other OS I've tested.

 I'd put money on that being drastically reduced if the allocation
didn't happen every call though.

> > There are still optimizations that could have been done to poll() to
> > speed it up but Linus has generally refused to add them.
> 
> 	Yep, so we invent new APIs to fix the deficiencies in the most common API's
> implementation. Whatever.

 No, we know that there are conditions where whatever you do to poll()
the latency kills you. And to fix that we need new APIs. Personally
I'd prefer to have poll() be as good a level triggered event mechanism
as it could be and have epoll just as good for edge triggered events
as it could be ... but I'm not the one you need to convince.

-- 
# James Antill -- james@and.org
:0:
* ^From: .*james@and\.org
/dev/null

  reply	other threads:[~2003-07-16  1:54 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-12 18:16 [Patch][RFC] epoll and half closed TCP connections Eric Varsanyi
2003-07-12 19:44 ` Jamie Lokier
2003-07-12 20:51   ` Eric Varsanyi
2003-07-12 20:48     ` Davide Libenzi
2003-07-12 21:19       ` Eric Varsanyi
2003-07-12 21:20         ` Davide Libenzi
2003-07-12 21:41         ` Davide Libenzi
2003-07-12 23:11           ` Eric Varsanyi
2003-07-12 23:55             ` Davide Libenzi
2003-07-13  1:05               ` Eric Varsanyi
2003-07-13 20:32       ` David Schwartz
2003-07-13 21:10         ` Jamie Lokier
2003-07-13 23:05           ` David Schwartz
2003-07-13 23:09             ` Davide Libenzi
2003-07-14  8:14               ` Alan Cox
2003-07-14 15:03                 ` Davide Libenzi
2003-07-14  1:27             ` Jamie Lokier
2003-07-13 21:14         ` Davide Libenzi
2003-07-13 23:05           ` David Schwartz
2003-07-13 23:11             ` Davide Libenzi
2003-07-13 23:52             ` Entrope
2003-07-14  6:14               ` David Schwartz
2003-07-14  7:20                 ` Jamie Lokier
2003-07-14  1:51             ` Jamie Lokier
2003-07-14  6:14               ` David Schwartz
2003-07-15 20:27             ` James Antill
2003-07-16  1:46               ` David Schwartz
2003-07-16  2:09                 ` James Antill [this message]
2003-07-13 13:12     ` Jamie Lokier
2003-07-13 16:55       ` Davide Libenzi
2003-07-12 20:01 ` Davide Libenzi
2003-07-13  5:24   ` David S. Miller
2003-07-13 14:07     ` Jamie Lokier
2003-07-13 17:00       ` Davide Libenzi
2003-07-13 19:15         ` Jamie Lokier
2003-07-13 23:03           ` Davide Libenzi
2003-07-14  1:41             ` Jamie Lokier
2003-07-14  2:24               ` POLLRDONCE optimisation for epoll users (was: epoll and half closed TCP connections) Jamie Lokier
2003-07-14  2:37                 ` Davide Libenzi
2003-07-14  2:43                   ` Davide Libenzi
2003-07-14  2:56                   ` Jamie Lokier
2003-07-14  3:02                     ` Davide Libenzi
2003-07-14  3:16                       ` Jamie Lokier
2003-07-14  3:21                         ` Davide Libenzi
2003-07-14  3:42                           ` Jamie Lokier
2003-07-14  4:00                             ` Davide Libenzi
2003-07-14  5:51                               ` Jamie Lokier
2003-07-14  6:24                                 ` Davide Libenzi
2003-07-14  6:57                                   ` Jamie Lokier
2003-07-14  3:12                     ` Jamie Lokier
2003-07-14  3:17                       ` Davide Libenzi
2003-07-14  3:35                         ` Jamie Lokier
2003-07-14  3:04                   ` Jamie Lokier
2003-07-14  3:12                     ` Davide Libenzi
2003-07-14  3:27                       ` Jamie Lokier
2003-07-14 17:09     ` [Patch][RFC] epoll and half closed TCP connections kuznet
2003-07-14 17:09       ` Davide Libenzi
2003-07-14 21:45       ` Jamie Lokier

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=m3ptkb2pfh.fsf@code.and.org \
    --to=james@and.org \
    --cc=davids@webmaster.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.