[SCM] Samba Shared Repository - branch master updated- release-4-0-0alpha6-1037-g193be43

Steven Danneman steven.danneman at isilon.com
Wed Feb 25 17:01:12 MST 2009


> > @@ -966,6 +899,13 @@ bool reinit_after_fork(struct messaging_context
> *msg_ctx,
> >  	 * numbers as each other */
> >  	set_need_random_reseed();
> >
> > +#ifdef WITH_MADVISE_PROTECTED
> > +	/* Protect parent process from being killed by kernel when system
> > +	 * memory is low.  Child processes can still be killed */
> > +	if(!parent_longlived)
> > +		madvise(NULL,0,MADV_PROTECT);
> > +#endif
> > +
> 
> I think that will still protect the child, I think we need to reset the
> flag in the child, or does fork() auto resets it?

Hey Metze,

Good point.  I've looked at the FreeBSD kernel implementation of MADV_PROTECT, and it is implemented as a per-process flag which will be inherited on fork.  Furthermore, there's no way to unset it even if we call madvise(NULL, 0, MADV_NORMAL).

So it appears our choices in behavior are protect all processes, or protect none.  I'm inclined to agree with Volker that protecting all children, some of which might be leaking is the wrong way to go.  I may just revert this one.

-Steven


More information about the samba-technical mailing list