On Thu, Mar 29, 2001 at 02:14:51PM -0800, Jerry Hong wrote:
> mmap() creates a mmaped memory associated with a
> physical file. If a process updates the mmaped memory,
> Linux will updates the file "automatically". If this
> is the case, why do we need msync()?
For the same reason you might need fsync() or fdatasync(). To force
changes to be written now, without having to munmap() the area, so that
you have a gurantee that current data is on disk and will not be lost.
> If this is not
> the case, what is the interval between 2 "WRITE" (IO
> request operation) request to the physical file
> because it really updates the physical file somehow
> even without msync().
Without syncing, Linux writes whenever it thinks it's appropriate, e.g.
when pages have to be freed (I think also when the bdflush writes back
data, i.e. every 30 seconds by default).
-- Andreas E. Bombe <firstname.lastname@example.org> DSA key 0x04880A44 http://home.pages.de/~andreas.bombe/ http://linux1394.sourceforge.net/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to email@example.com More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sat Apr 07 2001 - 21:00:08 EST