Robert Love [earlier interview] submitted a patch to implement strict VM overcommit on the 2.4-rmap kernel (ported from Alan Cox's 2.4 tree). Describing the patch, Robert says:
"We introduce new overcommit policies that attempt to never succeed an allocation that can not be fulfilled by the backing store and consequently never OOM. This is achieved through strict accounting of the committed address space and a policy to allow/refuse allocations based on that accounting."
From: Robert Love To: linux-kernel Subject: [PATCH] strict VM overcommit Date: 11 Jul 2002 22:28:39 -0700 The attached patch implements strict VM overcommit on top of the rmap VM. The basis for this is Alan Cox's work in 2.4-ac. This is a port of the strict VM overcommit out of 2.4-ac and into the standard kernel with the following changes: - one or two bugfixes (have sent/will send to Alan) - some cleanups, mostly for coding style - I did not bring over the debugging code - new overcommit policy for swapless machines So what is strict VM overcommit? We introduce new overcommit policies that attempt to never succeed an allocation that can not be fulfilled by the backing store and consequently never OOM. This is achieved through strict accounting of the committed address space and a policy to allow/refuse allocations based on that accounting. In the strictest of modes, it should be impossible to allocate more memory than available and impossible to OOM. All memory failures should be pushed down to the allocation routines -- malloc, mmap, etc. The new modes are available via sysctl (same as before). See Documentation/vm/overcommit-accounting for more information. Again, Alan deserves the credit for the design of all this. The patch is against 2.4.19-pre7-rmap13b but should apply to later releases with little trouble. Enjoy, Robert Love
From: Robert Love Subject: [PATCH] strict VM overcommit for stock 2.4 Date: 12 Jul 2002 10:30:39 -0700 A version of Alan's strict VM overcommit for the stock VM is available for 2.4.19-rc1 at: ftp://ftp.kernel.org/pub/linux/kernel/people/rml/vm/strict-overcommit/2.4/vm-strict-overcommit-rml-2.4.19-rc1-1.patch This is the same code I posted yesterday (see "[PATCH] strict VM overcommit for" from 20020711) except for the stock non-rmap VM in 2.4. Hugh Dickins sent me a few fixes, mostly for shmfs accounting, that he recently discovered... that code is not yet merged but will be, probably after this weekend. I still encourage testing and comments. Robert Love
KernelTrap interviews with members of the above thread:
Strict VM overcommit on 2.5-rmap
rml sent another patch, that implements this on 2.5-rmap.
I've omitted the patch in this comment. get it here.
From: Robert Love
To: linux-kernel
Subject: [PATCH] 2.5-rmap: VM strict overcommit
Date: 17 Jul 2002 10:59:23 -0700
The following patch implements VM strict overcommit on top of
2.5.26-akpm-rmap. Strict overcommit couples address space accounting
with a strict commit rule to ensure all allocated memory is backed and
consequently we never OOM. All memory failures should be pushed into
the allocation routines - a page access should never result in a process
kill.
The new strict overcommit policies are implemented via sysctl.
This is based on Alan Cox's work in 2.4-ac with some cleanup and a new
overcommit mode for swapless machines. Hugh Dickins also contributed
some fixes for shmfs.
While this patch is diffed off the rmap VM, there is nothing inherently
in it that requires rmap. Additionally, it is relatively low-impact on
other code and does not change the behavior of the system in the default
overcommit policy.
Questions, comments, and plastic zebra figurines are welcome.
Robert Love