From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 1 07:56:52 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A60A1065672 for ; Tue, 1 Apr 2008 07:56:52 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id D72BD8FC1F for ; Tue, 1 Apr 2008 07:56:51 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id C117067AAA6; Tue, 1 Apr 2008 09:56:36 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SBprjXyN7tVj; Tue, 1 Apr 2008 09:56:24 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id C501D67A9B2; Tue, 1 Apr 2008 09:56:24 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m317uO7u019811; Tue, 1 Apr 2008 09:56:24 +0200 (CEST) (envelope-from rdivacky) Date: Tue, 1 Apr 2008 09:56:24 +0200 From: Roman Divacky To: "Rao, Nikhil" Message-ID: <20080401075623.GA19770@freebsd.org> References: <20080329120018.0A8F5106567F@hub.freebsd.org> <12A5C15467D5B94F8E0FF265D9498ADD02CBF8FF@orsmsx419.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12A5C15467D5B94F8E0FF265D9498ADD02CBF8FF@orsmsx419.amr.corp.intel.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-hackers@freebsd.org Subject: Re: pfind() and the proc structure X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2008 07:56:52 -0000 On Mon, Mar 31, 2008 at 11:03:31PM -0700, Rao, Nikhil wrote: > Hi List, > > The pfind(..) (in kern_proc.c) function below returns the proc structure > for the PID passed in > > Say the thread that calls pfind() gets blocked at PROC_LOCK(p) (line 255 > below), in the meantime what prevents the process from exiting and > deallocating the proc structure ? Maybe I am missing something simple or > the answer requires knowledge of the mutex implementation. thats what the allproc_lock is there for