public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: root@chaos.analogic.com
Cc: Helge Hafting <helgehaf@aitel.hist.no>,
	Amir Hermelin <amir@montilio.com>,
	linux-kernel@vger.kernel.org
Subject: Re: how do file-mapped (mmapped) pages become dirty?
Date: Tue, 28 Oct 2003 11:23:23 -0500	[thread overview]
Message-ID: <3F9E97FB.5090603@nortelnetworks.com> (raw)
In-Reply-To: Pine.LNX.4.53.0310281042530.21561@chaos

Richard B. Johnson wrote:
> On Tue, 28 Oct 2003, Chris Friesen wrote:

>>Note however that you need an msync() -- fsync() and fdatasync() do not
>>catch changes to mmapped pages.

> Sure they do. fsync() will sync the whole file, regardless of
> whether or not it's been mapped. msync()  allows you to sync
> only a  specific portion and control how that portion is
> handled with some flags.

According to Rik van Riel and HPA, fsync() does not check page tables 
for dirty bits.  This is confirmed by my testing, in which msync() takes 
significantly longer than fsync() for the same file (in a ramdisk). 
msync() on the 3 pages dirtied took 39 usec, while fsync() on the whole 
200KB file took 12 usec.

Also, some googling leads to to believe that if the file is mmapped and 
you close() it, it won't get synced.

Chris

-- 
Chris Friesen                    | MailStop: 043/33/F10
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com


  reply	other threads:[~2003-10-28 16:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-28 12:35 how do file-mapped (mmapped) pages become dirty? Amir Hermelin
2003-10-28 15:00 ` Helge Hafting
2003-10-28 15:26   ` Chris Friesen
2003-10-28 15:45     ` Richard B. Johnson
2003-10-28 16:23       ` Chris Friesen [this message]
2003-10-28 15:39 ` Richard B. Johnson
2003-10-28 18:07 ` bill davidsen

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=3F9E97FB.5090603@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=amir@montilio.com \
    --cc=helgehaf@aitel.hist.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.com \
    /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