lkml.org 
[lkml]   [1998]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: I/O completion ports for Linux
Theodore Y. Ts'o writes:
> Date: Fri, 27 Mar 1998 17:52:38 -0800 (PST)
> From: Robey Pointer <robey@lag.net>
>
> The following is a patch against Linux 2.1.84 to implement "I/O
> completion ports" similar to VMS/NT. It will probably patch against
> more recent kernels, with slight changes. (I used 84 because it was
> the last one I could boot from when I started the patch -- the next
> version of the patch will be against one of the 2.1.9x probably.)
>
> An I/O completion port is a special fd that receives notification of
> completed I/O (hence the name...) from other fd's. You can start an
> I/O operation from one thread, and any other thread can pick up the
> result later, when the I/O is finished.
>
> Hi Robey,
>
> This is very welcome indeed. Just two days ago, I was talking
> to a fellow attendee at the Internet Engineering Task Force (the
> standards body for the Internet). This fellow is from.... ah.... a very
> large vendor which sells web browsers for Unix and NT. He was talking
> to me specifically about the possibility of adding I/O completion ports
> to Linux. The problem is that the poll() interface simply doesn't scale to
> 30,000+ connections. As a result, none of the Unix ports of his
> company's product is able to complete with the NT port of his product,
> and he considered this to be a Bad Thing.

Last year I wrote a series of 3 patches for the 2.1.5x series kernels
which provided ways to speed up polling.

The first patch removed unnecessary wait-queue manipulation, which
gave a speedup of 2x for select(2) and poll(2) with zero
timeouts. This patch was eventually integrated into Linus' kernels.

The second patch removed the need for f_op->poll calls (an optional
flag was added to struct file which could be queried by do_select()
and do_poll()). This speeded up polling by another 3x to 4x. This
patch required no changes to userspace code.

Finally, the third patch created the poll2(2) syscall. This provided a
more efficient interface to the kernel, and removed the need for an
application to search all fds to see where there was activity. Since
the kernel already has to search all fds for activity, it is more
efficient to pass back to userspace a short list of fds which have
activity, saving the application the time of searching the big list of
fds. This new syscall works well for both single-threaded and
multi-threaded servers.

Both the second and third patches would massively improve the
scalability of polling in Linux. Unfortunately, I didn't manage to
get either into Linus' kernel, so after perfecting my patches, I
stopped working on them. If I can get some encouragement from people
who's opinion has some weight with Linus, I could resurrect these
patches.

FYI: the second patch is gathering dust at:
http://www.atnf.csiro.au/~rgooch/kernel-patches.html

I posted quite a bit of benchmarking information back in September
regarding these patches, so troll through the archives if you're
interested.

Regards,

Richard....

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.470 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site