From owner-cvs-all@FreeBSD.ORG Fri Aug 18 17:47:14 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2314C16A4DE; Fri, 18 Aug 2006 17:47:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id B97A143D69; Fri, 18 Aug 2006 17:47:13 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id F0A0A46D71; Fri, 18 Aug 2006 13:47:12 -0400 (EDT) Date: Fri, 18 Aug 2006 18:47:12 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alexander Leidinger In-Reply-To: <200608172121.k7HLLUY5095480@repoman.freebsd.org> Message-ID: <20060818184107.B47942@fledge.watson.org> References: <200608172121.k7HLLUY5095480@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/compat/linux linux_misc.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: Fri, 18 Aug 2006 17:47:14 -0000 On Thu, 17 Aug 2006, Alexander Leidinger wrote: > - protect td->td_proc->p_pid with the proc lock in linux_getpid > in the amd64 (= non i386) case [1] Is this necessary? In principle, td->td_proc is static for a live thread bound to a process (i.e., in a system call, which the current thread presumable is, as long as td == curthread), p_pid is static for a live process that isn't exiting (so in a system call is not generally exiting). The native FreeBSD getpid() only acquires the process lock when following p_pptr, since this can change during a system call (i.e., as a result of the parent dying, and the child being re-parented to init(8)). Robert N M Watson Computer Laboratory University of Cambridge