summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_pageout.c
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/vm/vm_pageout.c
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/vm/vm_pageout.c')
-rw-r--r--sys/vm/vm_pageout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 723b14d..dc2b3b7 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -1206,10 +1206,10 @@ vm_pageout_oom(int shortage)
if (PROC_TRYLOCK(p) == 0)
continue;
/*
- * If this is a system or protected process, skip it.
+ * If this is a system, protected or killed process, skip it.
*/
if ((p->p_flag & (P_INEXEC | P_PROTECTED | P_SYSTEM)) ||
- (p->p_pid == 1) ||
+ (p->p_pid == 1) || P_KILLED(p) ||
((p->p_pid < 48) && (swap_pager_avail != 0))) {
PROC_UNLOCK(p);
continue;
OpenPOWER on IntegriCloud