diff options
author | trasz <trasz@FreeBSD.org> | 2011-03-18 06:47:23 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2011-03-18 06:47:23 +0000 |
commit | 1eb6b9150837b4b5960b2e1b3ae707f53e686068 (patch) | |
tree | 4dee977fab6db8680ddcd1b9234bbf25cb22aef0 /sys/vm/vm_pageout.c | |
parent | 285eac355c2e981a31d6b03f4f346a33dd9b1a5c (diff) | |
download | FreeBSD-src-1eb6b9150837b4b5960b2e1b3ae707f53e686068.zip FreeBSD-src-1eb6b9150837b4b5960b2e1b3ae707f53e686068.tar.gz |
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
Diffstat (limited to 'sys/vm/vm_pageout.c')
-rw-r--r-- | sys/vm/vm_pageout.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 8a018fd..e64a5ec 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -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. |