Description of problem: Can you help, we have a database product that uses memory mapping to access and update the database file. On Linux the flushing deamon can not flush the modified memory until a munmap or msync is called. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. A program that opens a file and map's the first 4k block. 2. Modify that memory block. 3. Crash the box after 30 seconds. Actual results: The disk file is not modified. Expected results: This disk file is modified. Additional info: Can I get bdflush deamon to detect and flush the dirty pages to disk? Is this a linux bug? The flushing deamon on the Unix operating system, flushes all write required pages to disk and that includes all those modified memory mapped pages, but linux doesn't.
From my reading of the SingleUnix spec, we are not required to sync mmaps to disk unless there is an explicit msync or if the region is unmapped. This is not a bug. Please reopen if you can find an assertion to the contrary in the standard, but I think this is simply a portability issue --- any code that assumes it does not need to msync is just non-portable, as it is relying on implementation-specific behaviour.