Re: msync() needed before munmap() when writing to shared mapping?

From: Andrew Morton
Date: Fri Apr 16 2004 - 17:48:53 EST


Jamie Lokier <jamie@xxxxxxxxxxxxx> wrote:
>
> I've followed the logic from do_munmap() and it looks good:
> unmap_vmas->zap_pte_range->page_remove_rmap->set_page_dirty.
>
> Can someone confirm this is correct, please?

yup, zap_pte_range() transfers pte dirtiness into pagecache dirtiness when
tearing down the mapping, leaving the dirty page floating about in
pagecache for kupdate/kswapd/fsync to catch. Longstanding behaviour.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/