Re: mmap() better than read() fro streaming, Was: Re: Streaming disk I/O kills file buffering and ma

Alan Cox (alan@lxorguk.ukuu.org.uk)
Wed, 25 Aug 1999 15:54:39 +0100 (BST)


> > ptr=mmap(blah)
> > mlock(ptr, ...)
> > munmap(ptr, len)
>
> will mlock() automatically cause all pages to be read from the file ?
> (I don't think)

> But since I already do an mlockall() at the beginnig, there is no need of
> additional mlock()s

>From man mlock

All pages which contain a
part of the specified memory range are guaranteed be resi-
dent in RAM when the mlock system call returns success-
fully and they are guaranteed to stay in RAM until the
pages are unlocked by munlock or munlockall

-
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/