lkml.org 
[lkml]   [1998]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Thread implementations...
From
Date
torvalds@transmeta.com (Linus Torvalds) writes:

> In particular, doing a mmap() itself is fairly expensive. It implies a
> lot of bookkeeping, and it also implies a fair amount of mucking around
> with CPU VM issues (TLBs, page tables etc). In short, it can be rather
> expensive.
>
> In contrast, a "sendfile()" approach can be extremely light-weight, and
> threads much better because it doesn't imply the same kinds of
> maintenance.

At the Expo, Larry McVoy made a suggestion that we allow reads and
writes to specify some form of token to identify the data being
transfered, without actually having to make the data visible in user
space at all.

That seems to make a lot of sense. The token gives access to an iovec
in physical memory, and we already have a lot of code to deal with
iovecs in the kernel. Being an iovec lets it represent non-contiguous
memory if we want. Having such a general purpose mechanism lets us
implement things like sendfile() (almost --- there's still a user-mode
process running the read/write loop), but also gives enough flexibility
to do more complex IO patterns without the data ever having to reach
virtual address space.

--Stephen


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

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