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

Michael S. Tsirkin mst at mellanox.co.il
Wed Feb 15 07:33:07 PST 2006


Quoting r. Gleb Natapov <glebn at voltaire.com>:
> 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. 

Right, so if you hide madvise inside reg_mr you create a problem.

-- 
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies



More information about the general mailing list