Author: kib
Date: Mon Nov 16 05:52:04 2015
New Revision: 290915
URL: https://svnweb.freebsd.org/changeset/base/290915

Log:
  VM daemon works in parallel with the pagedaemon threads, and, among
  other actions, swaps out kernel stacks of the processes.  On the other
  hand, currentl OOM logic which selects a process to kill in the
  critical condition, skips process with swapped-out thread.  Under some
  loads, this results in the big(gest) process being ignored by OOM.
  
  Do not skip a process which has inhibited thread due to the swap-out,
  in the OOM selection loop.  Note that killing such process requires
  the thread stack page-in, but sometimes this is the only way to
  recover.
  
  Reported and tested by:       pho
  Reviewed by:  alc
  Sponsored by: The FreeBSD Foundation
  MFC after:    3 weeks

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==============================================================================
--- head/sys/vm/vm_pageout.c    Mon Nov 16 05:38:40 2015        (r290914)
+++ head/sys/vm/vm_pageout.c    Mon Nov 16 05:52:04 2015        (r290915)
@@ -1554,7 +1554,8 @@ vm_pageout_oom(int shortage)
                        if (!TD_ON_RUNQ(td) &&
                            !TD_IS_RUNNING(td) &&
                            !TD_IS_SLEEPING(td) &&
-                           !TD_IS_SUSPENDED(td)) {
+                           !TD_IS_SUSPENDED(td) &&
+                           !TD_IS_SWAPPED(td)) {
                                thread_unlock(td);
                                breakout = 1;
                                break;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to