From owner-p4-projects@FreeBSD.ORG Mon Apr 24 21:31:36 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6427D16A413; Mon, 24 Apr 2006 21:31:36 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B70E16A410; Mon, 24 Apr 2006 21:31:36 +0000 (UTC) (envelope-from jb@what-creek.com) Received: from what-creek.com (what-creek.com [66.111.37.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC0F443D49; Mon, 24 Apr 2006 21:31:35 +0000 (GMT) (envelope-from jb@what-creek.com) Received: by what-creek.com (Postfix, from userid 102) id 4781B78C1D; Mon, 24 Apr 2006 21:31:35 +0000 (GMT) Date: Mon, 24 Apr 2006 21:31:35 +0000 From: John Birrell To: John Baldwin Message-ID: <20060424213134.GA62456@what-creek.com> References: <200604241913.k3OJDEAq055317@repoman.freebsd.org> <200604241637.08322.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200604241637.08322.jhb@freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: Perforce Change Reviews Subject: Re: PERFORCE change 96007 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Apr 2006 21:31:36 -0000 On Mon, Apr 24, 2006 at 04:37:07PM -0400, John Baldwin wrote: > On Monday 24 April 2006 15:13, John Birrell wrote: > > ASSERT(MUTEX_HELD(&dtrace_lock)); > > - for (i = 0; i < mp_ncpus; i++) { > > + for (i = 0; i < mp_maxid; i++) { > > Use <= with mp_maxid. The range is 0 .. mp_maxid (inclusive). > Yeah I see that now, thanks. I've weeded out mp_ncpus. What I really need to do is to use the cpu list and only allocate buffers for the cpus that exist. That's what Solaris does. I'm not sure what the locking issues are with doing that. DTrace also needs to go through the module list and it wants to hold a lock on that, but also allocate memory with wait. So what I really need is a version of the sx lock which is recursive for exclusive locks. Then I need to change the kern/kern_linker.c code to use that sort of lock, not just a mutex. Any thoughts on that? -- John Birrell