From: Kevin Easton <s3159795@student.anu.edu.au>
To: hugh@veritas.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4.18 no timestamp update on modified mmapped files
Date: Sat, 15 Jun 2002 19:12:30 +1000 [thread overview]
Message-ID: <20020615191230.A22499@beernut.flames.org.au> (raw)
In-Reply-To: <Pine.LNX.4.21.0206150830190.1185-100000@localhost.localdomain>
On Sat, 15 Jun 2002, Hugh Dickins wrote:
> On Sat, 15 Jun 2002, Kevin Easton wrote:
> > On Wed, 12 Jun 2002, Hugh Dickins wrote:
> > >
> > > But you didn't spell out the worst news on that option: read faults
> > > into a read-only shared mapping of a file which the application had
> > > open for read-write when it mmapped: the page must be mapped to disk
> > > at read fault time (because the mapping just might be mprotected for
> > > read-write later on, and the page then dirtied).
> >
> > Can't the page be mapped to disk at the page-dirtying-fault time? I
> > was under the impression that even after the mapping has been mprotected
> > for read-write, the first write to each page will still cause a page
> > fault that results in the page being marked dirty.
>
> It depends on the history of the mapping. mprotect() does not fault in
> any new pages, it just changes permissions on page table entries already
> present. So, if you're talking about a fresh mapping, or an area of a
> mapping which has not yet been accessed, you're correct. And you're
> correct if you're talking about a private mapping (which needs write
> protection to do copy-on-write). But those aren't cases of concern here.
>
> In general, there will already be some page table entries present,
> and mprotect() from shared readonly to readwrite currently adds write
> permission to those entries, and no write fault will then occur on
> first write to those pages. I was suggesting that we'd need to change
> that (to the behaviour you expect) if we were trying to guarantee disk
> space for unbacked dirty pages (without allocating on read fault).
>
> (I'm referring above to the implementation in Linux 2.4 or 2.5:
> I've not checked other releases or OSes, which could indeed arrange
> permissions so that there's always a page-dirtying fault.)
>
> Hugh
>
Hmm.. so how do such pages get marked dirty on architectures that don't
do it in hardware ("most RISC architectures" according to a comment in
memory.c)? Is the entire mapping made dirty when the write permissions
are added?
- Kevin
next prev parent reply other threads:[~2002-06-15 9:12 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-15 5:24 Kevin Easton
2002-06-15 8:10 ` Hugh Dickins
2002-06-15 9:12 ` Kevin Easton [this message]
2002-06-15 9:23 ` Russell King
-- strict thread matches above, loose matches on Subject: below --
2002-06-19 17:57 Randy.Dunlap
2002-06-16 4:35 Kevin Easton
2002-06-16 16:35 ` Hugh Dickins
2002-06-11 5:33 Keith Owens
2002-06-11 6:17 ` Andrew Morton
2002-06-11 6:29 ` Keith Owens
2002-06-11 6:49 ` Andrew Morton
2002-06-11 7:07 ` Keith Owens
2002-06-11 7:28 ` Andrew Morton
2002-06-11 9:10 ` Hugh Dickins
2002-06-11 9:33 ` Andrew Morton
2002-06-11 9:51 ` Hugh Dickins
2002-06-12 7:40 ` Alan Cox
2002-06-12 7:56 ` Andrew Morton
2002-06-12 14:52 ` Hugh Dickins
2002-06-13 2:25 ` jw schultz
2002-06-13 9:58 ` Hugh Dickins
2002-06-13 10:40 ` jw schultz
2002-06-11 18:09 ` Robert Love
2002-06-12 17:17 ` Pavel Machek
2002-06-11 6:39 ` Andrew Morton
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=20020615191230.A22499@beernut.flames.org.au \
--to=s3159795@student.anu.edu.au \
--cc=hugh@veritas.com \
--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®