lkml.org 
[lkml]   [2000]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
Subjectsendfile and aio_write: a match made in heaven?
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/

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