From owner-cvs-all@FreeBSD.ORG Tue Oct 24 22:54:14 2006 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from localhost.my.domain (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 69C1D16A407; Tue, 24 Oct 2006 22:54:14 +0000 (UTC) (envelope-from davidxu@freebsd.org) From: David Xu To: John Baldwin Date: Wed, 25 Oct 2006 06:54:11 +0800 User-Agent: KMail/1.8.2 References: <200610212359.k9LNxF2P014387@repoman.freebsd.org> <200610240647.03765.davidxu@freebsd.org> <200610241430.12149.jhb@freebsd.org> In-Reply-To: <200610241430.12149.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610250654.11455.davidxu@freebsd.org> Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern kern_exit.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Oct 2006 22:54:14 -0000 On Wednesday 25 October 2006 02:30, John Baldwin wrote: > On Monday 23 October 2006 18:47, David Xu wrote: > > On Monday 23 October 2006 23:33, John Baldwin wrote: > > > On Saturday 21 October 2006 19:59, David Xu wrote: > > > > davidxu 2006-10-21 23:59:15 UTC > > > > > > > > FreeBSD src repository > > > > > > > > Modified files: > > > > sys/kern kern_exit.c > > > > Log: > > > > Since revision 1.333 of kern_sig.c no longer uses P_WEXIT, the > > > > change opened a race window which can cause memory leak in signal > > > > queue. Here we free memory for signal queue when process state is set > > > > to PRS_ZOMBIE. > > > > > > Is there any reason to not just harvest it in wait() instead? > > > > I prefer to free it earlier rather than delaying it if I can. > > But we already do the free'ing "later" (wait() really isnt' all that later > than exit1() for most processes) for sigacts, limits, etc. It would seem > that sigqueue and sigacts would have nearly identical lifetimes. But if system is under heavily memory loaded, doesn't freeing it earlier make it better ? sigqueue does not have safe lifetime as sigacts, every thread has it, we check signal queue leak in thread_exit(), if you move the sigqueue_flush into wait1, then that code also has to be adjusted, because now not every thread will free the memory when it is exited, they no long have consistent behavior. David Xu