lkml.org 
[lkml]   [1999]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: zero-copy TCP fileserving
On Thu, 3 Jun 1999, Jamie Lokier wrote:
> It's often said that locking down pages has its own overhead due to TLB
> flushing complexity. However if you're clever about it, say from
> mmapping a file, or doing the direct reads Stephen Tweedie is
> contemplating, it's possible to do the zero-copy writes without ever
> having the page in any TLBs in the first place.

Exactly - the server mmap()'s the file but never actually accesses any
data. The socket write buffer addresses are translated by the kernel and
the needed pages are read in (if not already in mem) subsequently and
locked as the sending progresses, but all that is done in the kernels MMU
context so there shouldn't be any need to access the original process
context.

Since the process sleeps while doing the write(), it cannot munmap or do
nasty things to the mapping I guess. But the above is probably more
complicated than it sounds :)

Anyway the above would be useful for all kinds of servers - WWW, FTP, SMB
for example.

/Bjorn



-
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:52    [W:0.043 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site