sendfile and aio_write: a match made in heaven?

From: DanKegel@aol.com
Date: Fri Jan 07 2000 - 11:13:34 EST


khttpd is a fine way to get fast static file http performance, but one
shouldn't need to write code in the kernel to handle such a simple task.

sendfile() plus the new sigio stuff gets user programs most of the way towards
doing what khttpd does, but when sendfile() has to read from disk,
it blocks; this kills server performance. You can put the sendfile() in a
worker thread, but it'd be nice if there was another way to deal with this.

The aio_write interface could be extended to handle this
by adding two new fields to struct aiocb:
   int aio_filedes2;
   off_t aio_offset2;
These would only be checked if the aio_buf field were NULL,
in which case aio_write would cause bytes to be transferred
from aio_filedes2 to aio_filedes1.

This could potentially fit in very, very nicely with the new sigio stuff;
it would be AFAICS a drop-in replacement for synchronous sendfile()
in a sigio-style server.

Comments?

- Dan
(usually dank@alumni.caltech.edu)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jan 07 2000 - 21:00:09 EST