From: "Richard B. Johnson" <root@chaos.analogic.com>
To: Frank van Maarseveen <frankvm@xs4all.nl>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Memory mapped files question
Date: Mon, 14 Apr 2003 16:52:36 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.53.0304141645470.29118@chaos> (raw)
In-Reply-To: <20030414202741.GA26414@iapetus.localdomain>
On Mon, 14 Apr 2003, Frank van Maarseveen wrote:
> On Mon, Apr 14, 2003 at 04:13:52PM -0400, Richard B. Johnson wrote:
> >
> > Memory mapped files are supposed to be accessed through memory!
> > Any program that needs to know what's on the physical disk is
> > broken. If you need to write to files and know when they are
> > written to the physical media, you use a journaled file-system.
>
> It is not that simple.
> Shared mmaped files are _never_ flushed, at least in 2.4.x. So,
> without an explicit msync() a process (innd comes to mind) may loose
> years of updates upon a system crash or power outage.
>
> I have learned to live with it but I still find this a bit awkward.
>
> --
> Frank
>
But it is that simple. If you need to update the file with the
memory copy an explicit msync() must be used. Also note that
msync() takes some parameters that may be different in different
processes that access that mmapped file. Therefore, even msync()
goesn't guarantee that everything gets updated for the next
power outage. So, if you absolutely-posix-a-tively need to get
that data onto a disk, they you need to use some kind of signaling
mechanism (to pause all writers), explicitly write everything from
the lowest to the highest, update your check-point file and close
it, then restart all writers. Upon restart, you can unwind to
the check-point file and restart.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Why is the government concerned about the lunatic fringe? Think about it.
next prev parent reply other threads:[~2003-04-14 20:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-14 19:31 Perez-Gonzalez, Inaky
2003-04-14 19:42 ` Bryan Shumsky
2003-04-14 19:53 ` Alan Cox
2003-04-14 21:24 ` Chris Friesen
2003-04-14 20:13 ` Richard B. Johnson
2003-04-14 20:27 ` Frank van Maarseveen
2003-04-14 20:52 ` Richard B. Johnson [this message]
2003-04-14 22:08 ` H. Peter Anvin
2003-04-15 4:56 ` Jamie Lokier
2003-04-15 5:30 ` H. Peter Anvin
-- strict thread matches above, loose matches on Subject: below --
2003-04-14 19:50 Perez-Gonzalez, Inaky
2003-04-14 3:57 Bryan Shumsky
2003-04-14 14:36 ` Martin J. Bligh
2003-04-14 15:07 ` Antonio Vargas
2003-04-14 15:04 ` Martin J. Bligh
2003-04-14 18:07 ` H. Peter Anvin
2003-04-14 20:39 ` Chris Friesen
2003-04-14 21:12 ` H. Peter Anvin
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=Pine.LNX.4.53.0304141645470.29118@chaos \
--to=root@chaos.analogic.com \
--cc=frankvm@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
/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®