Messages in this thread | | | Subject | Re: Thread implementations... | From | (Stephen C. Tweedie) | Date | 25 Jun 1998 23:17:37 +0100 |
| |
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
| |