I'm making many small random writes to a mmaped file. I want to ensure consistency, so from time to time I use msync, but I don't want to keep track of every single small write that I made. In the current Linux kernel implementation, is there a performance penalty for using msync on the whole file? For example if the file is 100GB, but I only made total of 10MB changes? Is the kernel looping over every page in the range provided for msync to find the dirty pages to flush or are those kept on some sort of linked list/other structure?