From owner-freebsd-current@FreeBSD.ORG Wed Jan 28 22:41:37 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 402A510656D8; Wed, 28 Jan 2009 22:41:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0F7EE8FC36; Wed, 28 Jan 2009 22:41:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id A84AF46B0C; Wed, 28 Jan 2009 17:41:36 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0SMfUnD000565; Wed, 28 Jan 2009 17:41:30 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Roman Divacky Date: Wed, 28 Jan 2009 17:41:24 -0500 User-Agent: KMail/1.9.7 References: <20090128193318.GA42071@freebsd.org> <200901281521.17674.jhb@freebsd.org> <20090128220454.GA66961@freebsd.org> In-Reply-To: <20090128220454.GA66961@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901281741.25021.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 28 Jan 2009 17:41:30 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8915/Wed Jan 28 14:49:32 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-current@freebsd.org, scottl@freebsd.org Subject: Re: sysctl question X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2009 22:41:37 -0000 On Wednesday 28 January 2009 5:04:54 pm Roman Divacky wrote: > On Wed, Jan 28, 2009 at 03:21:17PM -0500, John Baldwin wrote: > > On Wednesday 28 January 2009 2:33:18 pm Roman Divacky wrote: > > > hi > > > > > > we dont need Giant to be held for sysctl_ctx_init/SYSCTL_ADD_*, right? > > > > Ugh, it looks like the sysctl tree locking is woefully inadequate, so we > > aren't quite ready for this yet. > > what do you mean? should all sysctl_ctx_init/SYSCTL_ADD_* consumers lock > Giant? I didnt not find a single one (except the scsi stuff) that locks > it... > > can you explain? thnx The supposed sysctl lock in kern_sysctl.c is actually worthless. None of the routines that actually manipulate the sysctl tree to add and remove nodes use it. Only sysctl itself uses it. It replaces an old 'memlock' hand-rolled lock from 4.xBSD (in 1.1 of kern_sysctl.c) that I think has to do with limiting the amount of wired memory, as it looks like sysctl used to always wire the userland buffers. I've just submitted some changes to p4 to make the sysctl lock actually protect the sysctl tree that I will test soon. Once that stuff is done then Giant can be removed here and other places. -- John Baldwin