From: ebiederm+eric@ccr.net (Eric W. Biederman)
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: Colin Plumb <colin@nyx.net>, linux-mm@kvack.org
Subject: Re: Why don't shared anonymous mappings work?
Date: 19 Jan 1999 09:23:44 -0600 [thread overview]
Message-ID: <m1hftnxp4v.fsf@flinx.ccr.net> (raw)
In-Reply-To: "Stephen C. Tweedie"'s message of "Tue, 19 Jan 1999 14:32:34 GMT"
>>>>> "ST" == Stephen C Tweedie <sct@redhat.com> writes:
ST> Hi,
ST> On Wed, 13 Jan 1999 14:31:41 -0700 (MST), Colin Plumb <colin@nyx.net>
ST> said:
>> Um, I just thought of another problem with shared anonymous pages.
>> It's similar to the zero-page issue you raised, but it's no longer
>> a single special case.
>> Copy-on-write and shared mappings. Let's say that process 1 has a COW
>> copy of page X. Then the page is shared (via mmap /proc/1/mem or some
>> such) with process 2. Now process A writes to the page.
ST> Invalid argument. This is *precisely* why mmap of /proc/X/mem is
ST> broken. We don't need to implement reasonable semantics for that case,
ST> because there _are_ no reasonable semantics for a page which can be both
ST> MAP_PRIVATE and MAP_SHARED in the same process.
Thank you for stomping on this, and my apologies a while ago for bringing it up.
Dosemu keeps coming to my mind. For 2.3 we need a better version of shared
memory for dosemu to use. shm is fine but it's not flexible enough.
For multiple MAP_PRIVATE & MAP_SHARED mappings, the most we can
theoretically allow is:
o If a page is updated, we need to update at most the page table entry, the write came from.
o If a write did not come from a page table entry we need to update no page table entries.
o During a mapping we need to update at most one old pte per page, and old
pte's that are updated must be in the same mm.
With those guidelines the best we can allow for /proc/self/mem is to
promote the page into a shared anonymous mapping, or fail.
Anything else would break the guidelines above. Which are what we need
if we want to avoid reverse page table entries, which is reasonable.
Eric
--
This is a majordomo managed list. To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org
next prev parent reply other threads:[~1999-01-19 15:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-01-13 21:31 Colin Plumb
1999-01-19 14:32 ` Stephen C. Tweedie
1999-01-19 15:23 ` Eric W. Biederman [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-01-15 6:43 Colin Plumb
1999-01-14 3:07 Colin Plumb
1999-01-15 6:07 ` Benjamin C.R. LaHaise
[not found] <199901061523.IAA14788@nyx10.nyx.net>
1999-01-06 19:51 ` Eric W. Biederman
1999-01-07 5:55 ` Eric W. Biederman
1999-01-13 20:21 ` Stephen C. Tweedie
1999-01-05 12:51 Colin Plumb
1999-01-06 4:05 ` Eric W. Biederman
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=m1hftnxp4v.fsf@flinx.ccr.net \
--to=ebiederm+eric@ccr.net \
--cc=colin@nyx.net \
--cc=linux-mm@kvack.org \
--cc=sct@redhat.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