msync in pmfs and other NVM filesystems

Dave Hansen dave.hansen at
Fri Feb 7 16:59:18 EST 2014

On 02/07/2014 01:43 PM, Byan, Steve wrote:
> I admit to having not read the code, but I'm hopeful that someone readily knows how, for a msync call, the kernel identifies the correct execute-in-place filesystem(s) to dispatch to for a range of memory. Suppose the application calls msync with a range that specifies more than one mapped file, and those two files are in different XIP filesystems?

The code is in mm/msync.c.  It's fairly straightforward.

Essentially, it walks the virtual addresses handed to the system call,
finds all the parts that are file-backed, and calls vfs_fsync() on the
_whole_ file.

FWIW, it doesn't look that efficient or optimized, but it seems to do
the trick.

More information about the Linux-pmfs mailing list