git: 9front

Download patch

ref: 1b397c76eaf0ab77d4ea8ee881cbcac2c1859be4
parent: 24d90235ed9be4b5f044614859ebefdafdd391c9
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Jun 15 13:13:19 EDT 2015

dontkill: only use noswap flag to mark processes as not to be terminated on oom

changing procmode has the nasty side effect that notes cannot
be posted to them, prventing sysfatal() and threadexitsall()
to cleanup properly.

recent kernels also check the noswap flag to void killing them
in out of memory condition, so this is really all we need now.

--- a/rc/bin/dontkill
+++ b/rc/bin/dontkill
@@ -7,8 +7,5 @@
 }
 # see /sys/src/9/port/proc.c:/^killbig
 psu | awk '$NF ~ /'$1'/ {
-c="/proc/"$2"/ctl"
-print "chmod +w "c
-print "@{echo noswap >"c"}"
-print "chmod -w "c
+print "@{echo noswap >/proc/"$2"/ctl}"
 }' | rc >/dev/null >[2=1]
--