On 07/04/12 16:47, Nico Williams wrote:

I don't see that the munmap definition assures that anything is written to
"disk".  The system is free to buffer the data in RAM as long as it likes
without writing anything at all.


Oddly enough the manpages at the Open Group don't make this clear.  So
I think it may well be advisable to use msync(3C) before munmap() on
MAP_SHARED mappings.  However, I think all implementors should, and
probably all do (Linux even documents that it does) have an implied
msync(2) when doing a munmap(2).  I really makes no sense at all to
have munmap(2) not imply msync(3C).

This assumes msync() has the behavior you expect.  See:

  http://pubs.opengroup.org/onlinepubs/009695399/functions/msync.html

In particular, the paragraph starting with "For mappings to files, ...".
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to