Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Mar 2011 01:40:34 -0700
From:      Julian Elischer <julian@freebsd.org>
To:        Edward Tomasz Napierala <trasz@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r219727 - head/sys/vm
Message-ID:  <4D831A82.7070308@freebsd.org>
In-Reply-To: <201103180647.p2I6lNCB051745@svn.freebsd.org>
References:  <201103180647.p2I6lNCB051745@svn.freebsd.org>

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




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