summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-04-06 10:43:01 +0000
committerkib <kib@FreeBSD.org>2010-04-06 10:43:01 +0000
commit47feb6893a7e6951cc6222a540259f6cfa144194 (patch)
treea5625108ba035786ce15e0432fc843dd55858bc0 /sys/kern
parente9fbee49d7ea41f69a621391939d5d7b8b13f82e (diff)
downloadFreeBSD-src-47feb6893a7e6951cc6222a540259f6cfa144194.zip
FreeBSD-src-47feb6893a7e6951cc6222a540259f6cfa144194.tar.gz
When OOM searches for a process to kill, ignore the processes already
killed by OOM. When killed process waits for a page allocation, try to satisfy the request as fast as possible. This removes the often encountered deadlock, where OOM continously selects the same victim process, that sleeps uninterruptibly waiting for a page. The killed process may still sleep if page cannot be obtained immediately, but testing has shown that system has much higher chance to survive in OOM situation with the patch. In collaboration with: pho Reviewed by: alc MFC after: 4 weeks
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sig.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 98a121b..706433d 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -2809,6 +2809,7 @@ killproc(p, why)
p, p->p_pid, p->p_comm);
log(LOG_ERR, "pid %d (%s), uid %d, was killed: %s\n", p->p_pid, p->p_comm,
p->p_ucred ? p->p_ucred->cr_uid : -1, why);
+ p->p_flag |= P_WKILLED;
psignal(p, SIGKILL);
}
OpenPOWER on IntegriCloud