noooo..... This isn't going to happen. There are many reasons.
Firstly, how can bdflush even know what pages to write? The dirtiness of
these pages is recorded *only* in some processor's hardware pte cache and/or
the software pagetables. Someone needs to go tell all the CPUs to writeback
their pte caches into the pagetables and then someone needs to walk the
pagetables propagating the pte dirty bit into the pageframes before we can
even start the I/O.
That's what msync does, in filemap_sync().
And even if bdflush did this automagically, it's the wrong thing to do
because the application could very well be repeatedly dirtying the pages.
Very probably. So we've just gone and done a ton of pointless I/O, over and
You can view MAP_SHARED as an IPC mechanism which uses the filesystem
namespace for naming. No way do these people want bdflush pointlessly
hammering the disk.
You can also view MAP_SHARED as a (strange) way of writing files out. If you
want to do that then fine, but you need to tell the kernel when you've
finished, just like write() does. You do that with msync.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to firstname.lastname@example.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/