Messages in this thread | | | Date | Wed, 2 Feb 2000 15:37:26 -0500 (EST) | From | Chuck Lever <> | Subject | Re: Adaptive thread creation by the kernel |
| |
On Wed, 2 Feb 2000, Jamie Lokier wrote: > Chuck Lever wrote: > > if (mincore(map, readlength, vec)) > > perror("mincore"); > > > > the vec[] contains a byte for each page you queried. each byte has value > > "1" if the page is already in memory, otherwise "0". > > You do a syscall every time you're going to read part of a file?
you can choose to do this, yes.
> How do you ensure it's still there by the time you actually read it?
the only way to ensure a page is in memory is to use mlock(). mincore() only provides a hint.
> How do you force the page in when it's not in memory -- spawn > another thread?
madvise(WILLNEED) is one way to do this asynchronously.
see Vivek Pai's work on the FLASH web server.
- Chuck Lever -- corporate: <chuckl@netscape.com> personal: <chucklever@netscape.net> or <cel@monkey.org>
The Linux Scalability project: http://www.citi.umich.edu/projects/linux-scalability/
- 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/
| |