Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Mar 2011 06:47:23 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r219727 - head/sys/vm
Message-ID:  <201103180647.p2I6lNCB051745@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103180647.p2I6lNCB051745>