[openib-general] Re: Re: madvise MADV_DONTFORK/MADV_DOFORK

Gleb Natapov glebn at voltaire.com
Mon Mar 13 07:02:50 PST 2006


On Sun, Mar 12, 2006 at 02:56:49PM +0200, Michael S. Tsirkin wrote:
> > Do you think new page flag is a viable solution? With the holy war
> > against new (and old) page flags. Besides fork will have to go from pte to 
> > struct page to check flags for each mapped page in the process!
> 
> I thought about this some more, and I think you are right.
> Adding overhead on fork and page flags won't fly.
Actually I was wrong about overhead, We already go from pte to page in
fork. But new flag will be hard to push.

> 
> My current thinking then goes vaguely along the lines of:
> 
> We need a way to distinguish the parent from child on COW. A flag in the VMA
> will do it.
> 
And what if child forks ones more?

> Then, when the parent (flag set) writes to the page and COW is activated, and
> the page is mapped into more than one process, and there is a driver keeping a
> reference on a page, we need to find everyone who maps the page and fix them
> to refer to the page copy rather than the original. The parent will still have
> the original page.
> 
rmap can help here I think.

--
			Gleb.



More information about the general mailing list