lkml.org 
[lkml]   [2000]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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/

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