Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Apr 1995 13:02:54 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        davidg@Root.COM, jgreco@brasil.moneng.mei.com
Cc:        freebsd-current@FreeBSD.org, hsu@cs.hut.fi
Subject:   Re: mmap bugs gone yet?
Message-ID:  <199504150302.NAA01886@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>>> With the merged VM/buffer cache, i doubt it will buy too much to mmap
>>> the files at all.
>>
>>This was not true on my Sun 3/60.  I never investigated to find out why,
>>however.

>   mmap should be faster at accessing files randomly and will eliminate an
>extra copy compared with doing read() system calls. It might be slower when
>modifying large amounts of large files. I think overall mmap would be faster,
>but YYMV.

Does mmap() do read-ahead or read-behind?  If it does, then it wouldn't be
so good for random access.  If it doesn't then it wouldn't be so good for
seuqential access.  What exactly happens if a huge file (larger than
physical memory) is accessed sequentially using read() and mmap()?  E.g.,
for simple (simplistic?) copying of files:

    read-write:
    size = huge; buf = malloc(size); read(0, buf, size); write(1, buf, size);
    mmap:
    something I can't write without RTFM :-)

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504150302.NAA01886>