OLS: A proposal for a new networking API
Posted Jul 23, 2006 17:16 UTC (Sun) by cventers
In reply to: OLS: A proposal for a new networking API
Parent article: OLS: A proposal for a new networking API
> One could propose implementing zero copy I/O by marking the pages that
> read() or write() refer to copy on write, using them directly in kernel
> space, and giving those that scribble on those pages a copy. I can see
> that read(2) might need to know this happenned and perform a copy after
> all. Disclaimer: I have not investigated the limitations of real
> hardware or size of any mm changes required.
Something like this was already proposed. The trouble is that the faulting
process is fairly expensive, and once you have to do the copy _plus_ the
TLB flushing you've just spent measurably more time than you would have
just doing the copy in the first place.
Copy on write is good in some places. During a fork, you have to
invalidate the TLB anyways, so it doesn't hurt too much to implement CoW
there (especially since many of the pages won't ever be copied, either due
to the application calling execve() or the application being a daemon like
Apache wherein every child only has some portion of non-shared data).
But playing tricks with virtual memory elsewhere (such as in the
networking hot path) is a really bad idea.
Further discussion: http://kerneltrap.org/node/6506
to post comments)