From owner-freebsd-hackers@FreeBSD.ORG Sat May 9 00:13:43 2009 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 BFDB1106566C for ; Sat, 9 May 2009 00:13:43 +0000 (UTC) (envelope-from jt@0xabadba.be) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.176]) by mx1.freebsd.org (Postfix) with ESMTP id 9C1348FC08 for ; Sat, 9 May 2009 00:13:43 +0000 (UTC) (envelope-from jt@0xabadba.be) Received: by wa-out-1112.google.com with SMTP id m38so983313waf.27 for ; Fri, 08 May 2009 17:13:43 -0700 (PDT) Received: by 10.114.131.11 with SMTP id e11mr3798708wad.75.1241828022929; Fri, 08 May 2009 17:13:42 -0700 (PDT) Received: from ?10.176.20.4? ([32.136.58.215]) by mx.google.com with ESMTPS id m25sm2047251waf.9.2009.05.08.17.13.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 08 May 2009 17:13:42 -0700 (PDT) References: <20090508214117.GY58540@hoeg.nl> Message-Id: <3C2B6A87-C127-4E1F-9A1E-DADF613B18BF@0xabadba.be> From: jt@0xabadba.be To: Ed Schouten In-Reply-To: <20090508214117.GY58540@hoeg.nl> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (5H11) Mime-Version: 1.0 (iPhone Mail 5H11) Date: Fri, 8 May 2009 20:13:32 -0400 Cc: FreeBSD Hackers , vasanth raonaik Subject: Re: concurrent sysctl implementation 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: Sat, 09 May 2009 00:13:44 -0000 Ed, Thanks :) I'll be implementing this as discussed over the next few months thanks for the technical detail I've been extremely busy with finals. I will write the list with my thoughts within the next week, sorry for the delay. =jt On May 8, 2009, at 17:41, Ed Schouten wrote: > Hi, > > * vasanth raonaik wrote: >> Hello Jt, >> >> I am a newbee in this alias. I am having a very basic question. It >> would be >> really good if you could give me some of this information. >> Could you please elaborate on what is the current architecture of >> sysctl >> implementation and How the concurrency would benefit us. > > Right now sysctl is synchronized using the sysctl lock. The problem is > that certain sysctls just block for a very long time (especially > some of > the GEOM ones). We also call sysctl when we execute new processes, to > obtain a random number for the stack protector. This means we have > quite > a lot of contention on it. This lock needs to be there, because > sysctls > can be added and removed on demand. > > I think I discussed this with John Baldwin (right?) and I think we > also > have the issue that we cannot allow an unbounded amount of concurrent > calls to sysctl, because sysctl wires memory. > > A solution would be to solve it as follows: > > - Use a semaphore, initialized to some insane high value to put an > upper > limit on the amount of concurrent sysctl calls. I'm not sure whether > this is really needed. Maybe this issue is not as serious as we think > it is. > > - Use an rw/rm/sxlock to protect the sysctl tree, but only pick up > the lock when we traverse parts of the sysctl tree that has > dynamically created entries. > > -- > Ed Schouten > WWW: http://80386.nl/