Patch to protect process from pageout killing
David Schultz
das at FreeBSD.ORG
Mon Mar 31 01:05:30 PST 2003
Thus spake Poul-Henning Kamp <phk at phk.freebsd.dk>:
> In message <200303280910.32307.wes at softweyr.com>, Wes Peters writes:
>
> >I've reworked my patch to use the madvise(2) syscall, like the original
> >4.x patch did. I've even documented it, in a man page of all places.
> >Please see attached patch. If nobody objects, I'll commit sometime this
> >weekend.
>
> I'm still not certain about the inheritance of this, do we want/is it
> inherited ?
>
> Also, thinking about it, on at least a handful of machines I would
> have more use for MADV_KILLMEFIRST having the exact opposite
> behaviour.
KILLMEFIRST is more of an advisory mechanism. See relevant
discussions of SIGDANGER, priority systems, etc. These are all
good ideas, but I think they belong in a domain of cooperation and
altruism, whereas MADV_PROTECT is the memory equivalent of rtprio.
At some level, there is generally a set of processes that should
never, ever be killed, e.g. postgres, sshd, apache. So you're
right that KILLMEFIRST would be useful, but MADV_PROTECT is a very
nice first step.
More information about the freebsd-arch
mailing list