You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jim Gettys <jg...@pa.dec.com> on 1999/03/02 20:31:01 UTC

OSDI paper - IO-Lite: A Unified I/O Buffering and Caching System

I am doing something that I seldom do: cross posting between two high volume
mailing lists. (linux-kernel and the Apache developer's lists). Sometimes
it is useful for us folks who build applications to attend base operating
system conferences, which I had not for a while.

I encourage everyone to read the paper:

IO-Lite: A Unified I/O Buffering and Caching System, by Vivek Pai, Peter
Druschel, and Willy Zwaenepoel, published in the 3rd Symposium on Operating
Systems Design and Implementation (OSDI '99) Proceedings, New Orleans,
Louisiana, February 22-25, 1999, pp15-28.

http://www.cs.rice.edu/~vivek/iol98/	 (OSDI paper)
http://www.cs.rice.edu/~vivek/vivekmsee/ (MS thesis)

At the latest (3rd) Symposium on Operating System Design and Implementation,
the "best of conference" award went to this paper, which reports on both
the design and implementation of a unified IO scheme.  I think the award was
well placed.

It shows a new I/O approach that is very general and flexible, and avoids
data copies with minimal overhead, even between processes.  The authors
use as an example Web service, and show very good performance gains. 

While I believe the paper overstates the benefits for "vanilla" web service, 
for CGI it should clearly be a major win.  IO-Lite avoids the redundant 
data copies that normally occur in the standard UNIX read/write semantics, 
and copies in the network layer. 

My intution tells me that the interfaces proposed here should be very 
useful for a very wide range of applications (including a certain window 
system I'm a bit fond of, which already took advantage of writev; the 
IO-Lite interfaces look better to me).

For full benefits to be reaped, an application can use new system call 
interfaces that IO-Lite introduces.  The immediate application that comes 
to my mind is Apache (ergo the cross posting), particularly as Apache 
thinks through its V2 design.  I hope that we can have a productive 
discussion and this thread may be able to provide clarification (I cc'ed 
the authors of the paper), and encourage IO-Lite's adoption.

This has been implemented in FreeBSD... And, of course, it would be nice
to have it in Linux as well, and for Apache to be able to take full
advantage of IO-Lite.

				- Jim Gettys


--
Jim Gettys
Industry Standards and Consortia
Compaq Computer Corporation
Visting Scientist, World Wide Web Consortium, M.I.T.
http://www.w3.org/People/Gettys/
jg@w3.org, jg@pa.dec.com


Re: OSDI paper - IO-Lite: A Unified I/O Buffering and Caching System

Posted by "Stephen C. Tweedie" <sc...@redhat.com>.
Hi,

On Tue, 2 Mar 1999 11:31:01 -0800, jg@pa.dec.com (Jim Gettys) said:

> For full benefits to be reaped, an application can use new system call 
> interfaces that IO-Lite introduces.  

> This has been implemented in FreeBSD... And, of course, it would be nice
> to have it in Linux as well, and for Apache to be able to take full
> advantage of IO-Lite.

Indeed.  Over LinuxWorld I spoke with Linus about the possibility of
adding raw IO to the kernel, and we ended up with a design which
separated out the actual IO from the business of setting up the user
space mappings by creating a separate abstraction layer describing the
physical memory into which the kernel can do the read or write.  This
already looks suspiciously like IO-Lite, especially if we make these
io_regions visible to user space.

--Stephen

Re: OSDI paper - IO-Lite: A Unified I/O Buffering and Caching System

Posted by Dean Gaudet <dg...@arctic.org>.
On Wed, 3 Mar 1999 bhyde@pobox.com wrote:

> 
> To give a very quick overview of this paper it is an I/O model
> based on what I might call the "I will never copy data" design
> pattern.  This is analagous to the sweet spot that Dean likes to
> point out where with perfect hardware, a perfect OS and carefully
> crafted code when you mmap the file and send it the bytes can
> avoid ever even entering the CPU or it's backside cache.

humming at wire speed, yeah! 

> They manage data in buffers that are lists of pairs
> <pointer,length> and sets of buffers reside in memory spaces with
> compatible ACL (access control list) settings.  Care is taken to
> get the data to flow from file system caches to I/O devices never
> never never ever coping the data.  Reference counts get involved
> to allow caching to work.  They are very fastidious that the
> buffers are write once, but I could not see how they manage the
> interaction with paging to enforce that and if they do how that
> actually works out in practice.

When you transfer a buffer across a protection boundary it's write
protected I think.  That kind of hurts, costs a TLB flush... oops I
claimed it wasn't so on linux-kernel, mustn't have been awake. 

> For example if you used this with Apache and three dozen backend
> modules the back end modules would write into buffers their HTTP
> responses and then pass those off to Apache in shared memory that
> presumably Apache would have only read only access to.  That
> doesn't look practical given the finite number of memory mapping
> registers most machines have.  Everybody knows that if you own
> the paging registers you rule the world.

Dude, paging registers?  memory mgmt has progressed a little beyond that
now ;)  We have two or three level page tables these days, you can futz
with memory at 4k or 8k boundaries. 

> I found thought provoking the term "early multiplexing" i.e. if
> you are to never copy the data you have to be sure that the
> incomming packets fall directly into the buffer space with the
> approprate ACL to cover all the down stream usage.

I'm still trying to figure out how this magic works.

> This is identical to the problem Apache has with wanting to get
> the incomming request into the process space and threading model
> of the module or back end process that actually is going to deal
> with it.

bingo. 

Dean


OSDI paper - IO-Lite: A Unified I/O Buffering and Caching System

Posted by bh...@pobox.com.
To give a very quick overview of this paper it is an I/O model
based on what I might call the "I will never copy data" design
pattern.  This is analagous to the sweet spot that Dean likes to
point out where with perfect hardware, a perfect OS and carefully
crafted code when you mmap the file and send it the bytes can
avoid ever even entering the CPU or it's backside cache.

They manage data in buffers that are lists of pairs
<pointer,length> and sets of buffers reside in memory spaces with
compatible ACL (access control list) settings.  Care is taken to
get the data to flow from file system caches to I/O devices never
never never ever coping the data.  Reference counts get involved
to allow caching to work.  They are very fastidious that the
buffers are write once, but I could not see how they manage the
interaction with paging to enforce that and if they do how that
actually works out in practice.

For example if you used this with Apache and three dozen backend
modules the back end modules would write into buffers their HTTP
responses and then pass those off to Apache in shared memory that
presumably Apache would have only read only access to.  That
doesn't look practical given the finite number of memory mapping
registers most machines have.  Everybody knows that if you own
the paging registers you rule the world.

I found thought provoking the term "early multiplexing" i.e. if
you are to never copy the data you have to be sure that the
incomming packets fall directly into the buffer space with the
approprate ACL to cover all the down stream usage.

This is identical to the problem Apache has with wanting to get
the incomming request into the process space and threading model
of the module or back end process that actually is going to deal
with it.

 - ben

Re: OSDI paper - IO-Lite: A Unified I/O Buffering and Caching System

Posted by Dean Gaudet <dg...@arctic.org>.
So it's somewhat ironic that one of my co-workers, Jason Evans, happens to
have recently written library code which provides all the pieces needed
for a userland "io-lite".  With a little bit of effort, this stuff could
be used for our stacked i/o and give the zero-copy coolness I've had
listed in STATUS for ages...

See: 

http://www.sqrl.org/sqrl

specifically,

http://www.sqrl.org/sqrl/download/snapshots/199903/libstash_s19990302a.tar.gz

Look at the "buf" definitions. 

Dean