[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hopefully a simple question on /proc/pid/mem



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.

--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://www.linux.eu.org/Linux-MM/