Subject: ... swap space (budgets)
To: R. C. Dowdeswell <elric@imrryr.org>
From: Gordon W. Ross <gwr@netbsd.org>
List: tech-kern
Date: 12/30/1998 16:18:01
R. C. Dowdeswell writes:
 > 
 > It seems to me that if we go for a strict non-overcommit strategy,
 > then the amount of swap that we need to allocate needs to really
 > be boosted by a huge number, and we'll never be able to get a very
 > high usage of said swap.
 > [...]

Not necessarily.  Budget for "anonymous" pages should be
(swap + availmem).  Deduct from the budget whenever a new,
writable mapping is created (map time, not fault time).
This includes cases like a debugger remapping a text page
read-write so it can install a breakpoint.

At map time, the kernel can return EBUYMOREMEM if the
new mapping would take us over budget.

Note, budget could be system-wide, per-process, or both.