svn commit: r219727 - head/sys/vm

Edward Tomasz Napierala trasz at FreeBSD.org
Fri Mar 18 06:47:24 UTC 2011


Author: trasz
Date: Fri Mar 18 06:47:23 2011
New Revision: 219727
URL: http://svn.freebsd.org/changeset/base/219727

Log:
  In vm_daemon(), when iterating over all processes in the system, skip those
  which are not yet fully initialized (i.e. ones with p_state == PRS_NEW).
  Without it, we could panic in _thread_lock_flags().
  
  Note that there may be other instances of FOREACH_PROC_IN_SYSTEM() that
  require similar fix.
  
  Reported by:	pho, keramida
  Discussed with:	kib

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==============================================================================
--- head/sys/vm/vm_pageout.c	Thu Mar 17 22:47:52 2011	(r219726)
+++ head/sys/vm/vm_pageout.c	Fri Mar 18 06:47:23 2011	(r219727)
@@ -1281,6 +1281,8 @@ vm_pageout_oom(int shortage)
 	FOREACH_PROC_IN_SYSTEM(p) {
 		int breakout;
 
+		if (p->p_state != PRS_NORMAL)
+			continue;
 		if (PROC_TRYLOCK(p) == 0)
 			continue;
 		/*
@@ -1649,6 +1651,8 @@ vm_daemon()
 		FOREACH_PROC_IN_SYSTEM(p) {
 			vm_pindex_t limit, size;
 
+			if (p->p_state != PRS_NORMAL)
+				continue;
 			/*
 			 * if this is a system process or if we have already
 			 * looked at this process, skip it.


More information about the svn-src-head mailing list