From owner-freebsd-arch@FreeBSD.ORG Fri Dec 17 08:19:20 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 78D5316A4CE; Fri, 17 Dec 2004 08:19:20 +0000 (GMT) Received: from mail.sam-solutions.net (mail.sam-solutions.net [217.21.35.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id A0F6343D2D; Fri, 17 Dec 2004 08:19:19 +0000 (GMT) (envelope-from ssouhlal@FreeBSD.org) Received: from c71.sam-solutions.net ([217.21.35.67]) by mail.sam-solutions.net with esmtp (Exim 4.34) id 1CfDKY-0000i3-Ke; Fri, 17 Dec 2004 10:19:18 +0200 Received: from mail pickup service by c71.sam-solutions.net with Microsoft SMTPSVC; Fri, 17 Dec 2004 10:19:17 +0200 Received: from mail.sam-solutions.net ([217.21.35.41]) by c71.sam-solutions.net over TLS secured channel with Microsoft SMTPSVC(6.0.3790.211); Fri, 17 Dec 2004 06:51:30 +0200 Received: from speedy.tutby.com ([195.209.41.194] helo=tut.by) by mail.sam-solutions.net with esmtp (Exim 4.34) id 1CfA5Q-0003rX-P0 for m.boyarov@sam-solutions.net; Fri, 17 Dec 2004 06:51:28 +0200 Received: from by tut.by (CommuniGate Pro RULES 4.1.8) with RULES id 48088987; Fri, 17 Dec 2004 06:51:28 +0200 X-Autogenerated: Mirror X-Mirrored-by: Received: from [195.209.34.110] (HELO tut.by) by tut.by (CommuniGate Pro SMTP 4.1.8) with ESMTP id 48088983 for max_b@tut.by; Fri, 17 Dec 2004 06:51:28 +0200 Received: from mx8.mail.ru ([194.67.23.28] verified) by tut.by (CommuniGate Pro SMTP 4.1.8) with ESMTP id 169004106 for max_b@tut.by; Fri, 17 Dec 2004 07:49:08 +0200 Received: from mail by mx8.mail.ru with local id 1CfA5Q-000IC0-00 for max_b@tut.by; Fri, 17 Dec 2004 07:51:28 +0300 X-ResentFrom: Received: from [216.136.204.119] (port=25 helo=mx2.freebsd.org) by mx8.mail.ru with esmtp id 1CfA5P-000IBn-00 for m.boyarov@bk.ru; Fri, 17 Dec 2004 07:51:27 +0300 Received-SPF: pass (mx8.mail.ru: domain of freebsd.org designates 216.136.204.119 as permitted sender) client-ip=216.136.204.119; envelope-from=owner-freebsd-current@freebsd.org; helo=mx2.freebsd.org; Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id 1F83957FE1; Fri, 17 Dec 2004 04:50:43 +0000 (GMT) (envelope-from owner-freebsd-current@freebsd.org) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 9637E16A4DE; Fri, 17 Dec 2004 04:50:33 +0000 (GMT) Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2BB2D16A4F5; Fri, 17 Dec 2004 04:50:26 +0000 (GMT) Received: from server1.astraldream.net (astraldream.net [69.20.5.160]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84C0443D3F; Fri, 17 Dec 2004 04:50:25 +0000 (GMT) (envelope-from ssouhlal@FreeBSD.org) Received: from [192.168.0.98] (pool-138-88-246-116.res.east.verizon.net [138.88.246.116]) (authenticated (0 bits)) by server1.astraldream.net (8.11.6/8.11.6) with ESMTP id iBH4oEW12433 (using TLSv1/SSLv3 with cipher RC4-SHA (128 bits) verified NO); Thu, 16 Dec 2004 23:50:23 -0500 In-Reply-To: <200412131232.55051.max@love2party.net> References: <94AE3F5A-4CD6-11D9-8BD6-000A95C4D7BC@FreeBSD.org> <200412130913.20215.max@love2party.net> <200412131232.55051.max@love2party.net> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <21F934EB-4FE7-11D9-B1F7-000A95C4D7BC@FreeBSD.org> Content-Transfer-Encoding: 7bit From: Suleiman Souhlal Date: Thu, 16 Dec 2004 23:50:11 -0500 To: Max Laier X-Mailer: Apple Mail (2.619) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Sender: owner-freebsd-current@freebsd.org X-Spam: Not detected X-Spam-Scanned-By: Spamassassin X-Virus-Scanned-By: AVP Antivirus X-OriginalArrivalTime: 17 Dec 2004 04:51:30.0417 (UTC) FILETIME=[130A1610:01C4E3F4] cc: freebsd-current@FreeBSD.org cc: freebsd-arch@FreeBSD.org Subject: Re: sysctl locking X-BeenThere: freebsd-arch@freebsd.org List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2004 08:19:20 -0000 Hello, On Dec 13, 2004, at 6:32 AM, Max Laier wrote: > 1) Extend sysctl_add_oid() to accept an additional mutex argument. > 2) Extend the simple sysctl handler to use this mutex to protect the > actual > write(?read?). We must not hold the mutex during the useland copy > in/out so > we must move to temporary storage. > 3) To maintain the current API and behavior we use &Giant as the > default > fallback argument. This might need some extension for complex > handler (i.e. > no mutex given -> acquire Giant before calling the complex handler). > > What do people think of this? Does it make any sense? Should we be > concerned > at all? Does the extension make sense? Comments? I have implemented this. The diff is at http://people.freebsd.org/~ssouhlal/sysctl-sx-locking-20041214.diff It also needs the patch at http://people.freebsd.org/~ssouhlal/sx_xlocked.diff which introduces a sx_xlocked() function. Unfortunately, we still need to look at every single SYSCTL_PROC, and make either grab Giant, lock correctly, or make sure it doesn't need any locking. :( -- Suleiman Souhlal | ssouhlal@vt.edu The FreeBSD Project | ssouhlal@FreeBSD.org _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"