Out of VM idea

Rik van Riel (H.H.vanRiel@phys.uu.nl)
Tue, 28 Apr 1998 11:20:57 +0200 (MET DST)


Hi,

Following some observations from Michael Remski (sent
to me by private e-mail), I've come to the conlusion
that we really should do something about out-of-VM
situations.

We can't just kill the next process that does a memory
allocation, since:
- that process may have IOPL permission and can be the
X server, rendering the entire system useless
- the system might be far into lala-thrash-land by the
time we get to the above sitation
- we don't want to kill some small app/daemon that just
happened to need some memory now. We want to get rid
of the culprit...

We probably should do something like this:
- add a percentage/promillage of memory that should be reserved
for root
- don't allow allocations when free(mem+swap)/total(mem+swap)
comes below the percentage set and the user isn't root.
- kill the largest non-IOPL process (with another penalty for
root processes, eg 'if(p->euid == 0) size >> 1' when the
free memory gets below an even lower limit.
(this could seriously hose some people, but it's better than
nothing :-)
- add some other flags to switch on/off root-proc killing and/or
the associated penalty alltoghether
- add a flag to switch off the entire mechanism

This would give a /proc/sys/vm/outofmem:
50 20 1 1 1

For:
5.0 percent reserved for root
2.0 percent kill-border
root-proc killing enabled
root-penalty enabled
out-of-vm process killing enabled

But, before I go and implement this, I'd like your opinions
first...

Awaiting the flamefest,

Rik.
+-------------------------------------------+--------------------------+
| Linux: - LinuxHQ MM-patches page | Scouting webmaster |
| - kswapd ask-him & complain-to guy | Vries cubscout leader |
| http://www.phys.uu.nl/~riel/ | <H.H.vanRiel@phys.uu.nl> |
+-------------------------------------------+--------------------------+

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu