svn commit: r219727 - head/sys/vm

Julian Elischer julian at freebsd.org
Fri Mar 18 08:40:23 UTC 2011


On 3/17/11 11:47 PM, Edward Tomasz Napierala wrote:
> 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.

In the past each process was only put on the process list after it was 
fully set up.
Did someone change that recently?  that would be "A Bad Thing" (TM).

>
>    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-all mailing list