From: Andrew Morton <akpm@osdl.org>
To: linda.dunaphant@ccur.com
Cc: trond.myklebust@fys.uio.no, linux-kernel@vger.kernel.org
Subject: Re: NFS: msync required for data writes to server?
Date: Thu, 12 May 2005 17:57:20 -0700 [thread overview]
Message-ID: <20050512175720.74ea6a3e.akpm@osdl.org> (raw)
In-Reply-To: <1115925686.6319.3.camel@lindad>
Linda Dunaphant <linda.dunaphant@ccur.com> wrote:
>
> Hi Trond,
>
> On our 2.6.9 based systems, data written using mmap(MAP_SHARED) on a NFS
> client is *never* being pushed out to the server if an explicit msync call
> is not issued before the munmap.
>
> On 11/12/04, there was a message thread concerning NFS corruption when
> using mmap/munmap:
>
> http://marc.theaimsgroup.com/?l=linux-nfs&m=110028817508318&w=2
>
> In this thread you stated:
>
> mmap() offers absolutely NO guarantees that the file will be synced to
> disk on close. Use msync(MS_SYNC) if you want such a guarantee.
>
> Are you saying that the data will *never* be written to the server? Could
> you please clarify your position on this further?
The dirty pages will float about in memory until something causes them to
be written back. That "something" could be
msync/fsync/sync/pdflush/journal commit or, eventually, the VM system
deciding that it wants to reuse that physical page for something else.
So yes, the page will eventually be written to the server, but not for
quite some time.
In the case where the page was dirtied by mmap and was then unmapped (via
munmap or via program exit), the page will be marked dirty in pagecache
when its pagetable entry is unmapped. That makes the page's dirtiness
visible to the VFS and the page will be written out approximately 30
seconds later by pdflush.
next prev parent reply other threads:[~2005-05-13 1:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-12 19:21 Linda Dunaphant
2005-05-13 0:57 ` Andrew Morton [this message]
2005-05-13 2:21 ` Linda Dunaphant
2005-05-13 2:42 ` Andrew Morton
2005-05-13 3:41 ` Linda Dunaphant
2005-05-13 3:48 ` Trond Myklebust
2005-05-13 23:57 ` Linda Dunaphant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050512175720.74ea6a3e.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linda.dunaphant@ccur.com \
--cc=linux-kernel@vger.kernel.org \
--cc=trond.myklebust@fys.uio.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®