Re: mmap() versus read()

Marijn Meijles (marijn@stack.nl)
Sun, 8 Mar 1998 20:19:42 +0100


You wrote:
> Hi,
>
> On Fri, 06 Mar 1998 08:29:34 -0500, mlord <mlord@pobox.com> said:
>
> > Alan Cox wrote:
> >> mmap doesnt do readahead on faults in 2.0.x, that increases the I/O load
> >> when paging mmap data versus read() quite a lot
>
> > I wonder why we bother paging mmap'd data that could instead
> > be re-read from the original file on disk? Or did I read that wrong?
>
> Hmm? Paging mmap()ed data *is* exactly the same as rereading it from
> the original file on disk. "Paging" refers to the pulling in of virtual
> memory pages from any location on disk, not necessarily from the swap
> file. The difference is only that mapped files get paged from their
> primary storage, whereas anonymous private data gets paged into and out
> of swap files.
>
Why does Linux page executables from their original location? Isn't that slower
than putting it into the swapfile because you have to wade through the
filesystem layer when you need to page in? Or is the penalty for writing it
into the swap bigger than the filesystem overhead?
-- 
Marijn
---
This text is ROT-52 encrypted

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