From: ebiederm@xmission.com (Eric W. Biederman)
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: "Benjamin C.R. LaHaise" <blah@kvack.org>,
Alexander Viro <viro@math.psu.edu>,
Richard F Weber <rfweber@link.com>,
linux-mm@kvack.org
Subject: Re: Hopefully a simple question on /proc/pid/mem
Date: 01 May 2001 09:16:48 -0600 [thread overview]
Message-ID: <m1u235p09r.fsf@frodo.biederman.org> (raw)
In-Reply-To: "Stephen C. Tweedie"'s message of "Tue, 1 May 2001 10:36:31 +0100"
"Stephen C. Tweedie" <sct@redhat.com> writes:
> Hi,
>
> On Mon, Apr 30, 2001 at 07:13:53PM -0600, Eric W. Biederman wrote:
>
> > > Hint: think about what happens if you make a shared mapping of a
> > > private proc/*/mem region...
> >
> > Now that we have reusable swap cache pages we could make it work
> > correctly, except for the case of the first write a private mapping of
> > file. Not that we would want to...
>
> Think about fork. If a parent forks and then touches a private page
> before the child does, it's the parent which gets a new page. The
> supposed shared mmap of the parent now points to the child's page, not
> the parent's. COW basically just can't do the right thing if a page
> is both shared and private at the same time.
Right. This is a different context but it has the same properties of
what I was thinking of. The fact that fork has the problem too,
means it's definitely not doable right now. At least not with the
intuitive semantics. If we either denied shared mappings of private
mappings or simply promoted them to shared mappings we could easily do a
non-buggy implementation.
The problem isn't really COW, the copy on write is easy. The hard
part it to appropriately share the resulting copy. If we really had
to do this it might be possible by playing with the open method in the
vma_operations. Implementation wise I think a shared private mapping
of a file is really a harder case than fork COW pages.
I think it is a better argument that since nothing except a mmap of
/proc/pid/mem needs the complexity of simultaneously shared and
private mappings, it isn't worth supporting them.
Eric
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
next prev parent reply other threads:[~2001-05-01 15:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-30 18:17 Richard F Weber
2001-04-30 18:50 ` Stephen C. Tweedie
2001-04-30 19:00 ` Alexander Viro
2001-04-30 19:02 ` Benjamin C.R. LaHaise
2001-04-30 19:26 ` Alexander Viro
2001-04-30 19:26 ` Benjamin C.R. LaHaise
2001-04-30 19:44 ` Alexander Viro
2001-04-30 21:58 ` Stephen C. Tweedie
2001-05-01 1:13 ` Eric W. Biederman
2001-05-01 9:36 ` Stephen C. Tweedie
2001-05-01 15:16 ` Eric W. Biederman [this message]
2001-04-30 19:13 ` Richard F Weber
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=m1u235p09r.fsf@frodo.biederman.org \
--to=ebiederm@xmission.com \
--cc=blah@kvack.org \
--cc=linux-mm@kvack.org \
--cc=rfweber@link.com \
--cc=sct@redhat.com \
--cc=viro@math.psu.edu \
/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