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

Gleb Natapov glebn at voltaire.com
Wed Feb 15 07:27:12 PST 2006


On Wed, Feb 15, 2006 at 05:18:42PM +0200, Michael S. Tsirkin wrote:
> Quoting r. Gleb Natapov <glebn at voltaire.com>:
> > > > Because the program should be careful to not put the data it needs in the
> > > > same page with registered buffer.
> > > 
> > > It should? Why should it?
> >
> > Because after fork it may not find it. (But somehow I think you know
> > that.)
> 
> I dont. The private data will get COWed properly - its only with DMA
> data that we have a problem. No?
> 
Suppose you have this code:

char buf[1000];
char *prog="/bin/true";


main()
{
	reg_mr (buf, 1000);
	madvise (buf, 1000, DONTCOPY);
	system (prog);
}

if buf and prog are on the same page (most certainly) "/bin/true" will
never run. 

--
			Gleb.



More information about the general mailing list