Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Mar 2003 09:10:32 -0800
From:      Wes Peters <wes@softweyr.com>
To:        "Poul-Henning Kamp" <phk@phk.freebsd.dk>, David Schultz <das@FreeBSD.ORG>
Cc:        freebsd-arch@FreeBSD.ORG
Subject:   Re: Patch to protect process from pageout killing
Message-ID:  <200303280910.32307.wes@softweyr.com>
In-Reply-To: <14382.1048580753@critter.freebsd.dk>
References:  <14382.1048580753@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

--Boundary-00=_IIIh+WfRJfXpokV
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Tuesday 25 March 2003 00:25, Poul-Henning Kamp wrote:
>
> As I see it, there is a need for several mechanisms:
>
> 1. A mechanism to export to userland enough information about the
>    current RAM availability, so that phkmalloc and application
>    specific code can make intelligent choices before things go bad.
>
> 2. A mechanism to alert userland to the fact that things _have_ gone
>    bad.
>
> 3. A mechanism to influence the "Who do we kill ?" decision once
>    things have gone from bad to worse.
>
> To tackle them from behind:
>
> Wes has a proposal for #3 which is a per-process flag which says
> "I'm sacred".  I think that is a sound principle since that is
> usually exactly what people want:  Do Not Kill This Process.
>
> Certain processes already enjoy special protection, pid==1 most
> notably, this would just be a way to make the same protection
> available to other processes.  I'm not happy about using the
> resourcelimit code for booleans, and I don't think the flag
> should be inherited, but otherwise I'm for the idea.

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.

> We have the SIGDANGER proposal for #2, but I think we need to have
> two severities:  "Out of RAM" and "Out of VM".  A program like
> fsck would start to recycle cached sectors once we're out of RAM.

I'll work with Garance to create a proposal, some pseudocode, something 
like a design.  Then we can bikeshed that.  Mike Murphy is helping 
silently at work, letting me bounce ideas off him and look at the man 
pages on his AIX machine.

> But I have not seen anybody come up with a good proposal for
> #1, and that is where the main benefit would be derived:  It would
> allow processes to be good citizens and adjust to the present
> situation.

Added to think-about queue...

-- 

        Where am I, and what am I doing in this handbasket?

Wes Peters                                               wes@softweyr.com

--Boundary-00=_IIIh+WfRJfXpokV--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303280910.32307.wes>