linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Stephen C. Tweedie" <sct@redhat.com>
To: "Benjamin C.R. LaHaise" <blah@kvack.org>
Cc: James Simmons <jsimmons@edgeglobal.com>,
	Linux MM <linux-mm@kvack.org>, Stephen Tweedie <sct@redhat.com>
Subject: Re: page faults
Date: Fri, 22 Oct 1999 14:06:32 +0100 (BST)	[thread overview]
Message-ID: <14352.24920.122613.498709@dukat.scot.redhat.com> (raw)
In-Reply-To: <Pine.LNX.3.96.991021153709.3464D-100000@kanga.kvack.org>

Hi,

On Thu, 21 Oct 1999 15:40:15 -0400 (EDT), "Benjamin C.R. LaHaise"
<blah@kvack.org> said:

> On Thu, 21 Oct 1999, James Simmons wrote:
>> Quick question. If two processes are sharing the same memory but no page
>> fault has happened. THen process A causes a page fault. If process B tries
>> to access the page that process A already page fault will process B cause
>> another page fault. Or do page faults only happen once no matter how many
>> process access it. 

> Only the first time the page is accessed is there a fault to put the entry
> into the page table, regardless of the processes sharing the page.  

No.  If a process mmap()s a file and forks, then the two processes will
page fault independently.  Similarly if two separate processes mmap()
the same file, they will page fault independently.  Finally, if a
process has a data page which becomes faulted out and the process forks,
then the two resuling processes will both have to take independent page
faults to map the page.

However, there will only ever be one major fault (ie. one fault which
has to bring data in from disk).  If multiple processes share the same
page, then the second and all subsequent processes to fault on that page
will take a minor page fault which will just find the existing page in
memory and map that into the faulting process's page tables.

--Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/

  parent reply	other threads:[~1999-10-22 13:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-21 16:31 James Simmons
1999-10-21 19:40 ` Benjamin C.R. LaHaise
1999-10-22  0:47   ` Wang Yong
1999-10-22 13:06   ` Stephen C. Tweedie [this message]
1999-10-22 14:59     ` James Simmons
1999-10-22 15:15       ` Benjamin C.R. LaHaise
1999-10-22 17:35       ` Stephen C. Tweedie
1999-10-22 23:31         ` James Simmons
1999-10-24 17:15           ` Eric W. Biederman
1999-10-25 17:27             ` William J. Earl
1999-10-26 13:50               ` Marcus Sundberg
1999-10-26 14:00               ` Eric W. Biederman
1999-10-26 15:11                 ` James Simmons
1999-10-26 18:04                 ` William J. Earl
1999-10-26  9:05             ` Ralf Baechle
1999-10-29 14:52               ` James Simmons
1999-11-01 11:57                 ` Stephen C. Tweedie

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=14352.24920.122613.498709@dukat.scot.redhat.com \
    --to=sct@redhat.com \
    --cc=blah@kvack.org \
    --cc=jsimmons@edgeglobal.com \
    --cc=linux-mm@kvack.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