From owner-freebsd-current@FreeBSD.ORG Wed Jan 28 20:41:19 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 38814106575F; Wed, 28 Jan 2009 20:41:18 +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 579728FC20; Wed, 28 Jan 2009 20:41:18 +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 DF18B46B65; Wed, 28 Jan 2009 15:41:17 -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 n0SKekck099624; Wed, 28 Jan 2009 15:41:12 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org Date: Wed, 28 Jan 2009 15:21:17 -0500 User-Agent: KMail/1.9.7 References: <20090128193318.GA42071@freebsd.org> In-Reply-To: <20090128193318.GA42071@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901281521.17674.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 15:41:12 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8914/Wed Jan 28 01:40:00 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: Roman Divacky , 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 20:41:21 -0000 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. > if that's true, is this ok for commit? > > Index: cam/scsi/scsi_da.c > =================================================================== > --- cam/scsi/scsi_da.c (revision 187838) > +++ cam/scsi/scsi_da.c (working copy) > @@ -1086,7 +1086,6 @@ > snprintf(tmpstr, sizeof(tmpstr), "CAM DA unit %d", periph->unit_number); > snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); > > - mtx_lock(&Giant); > sysctl_ctx_init(&softc->sysctl_ctx); > softc->flags |= DA_FLAG_SCTX_INIT; > softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, > @@ -1094,7 +1093,6 @@ > CTLFLAG_RD, 0, tmpstr); > if (softc->sysctl_tree == NULL) { > printf("dasysctlinit: unable to allocate sysctl tree\n"); > - mtx_unlock(&Giant); > cam_periph_release(periph); > return; > } > @@ -1108,7 +1106,6 @@ > &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", > "Minimum CDB size"); > > - mtx_unlock(&Giant); > cam_periph_release(periph); > } > > Index: cam/scsi/scsi_cd.c > =================================================================== > --- cam/scsi/scsi_cd.c (revision 187838) > +++ cam/scsi/scsi_cd.c (working copy) > @@ -555,8 +555,6 @@ > snprintf(tmpstr, sizeof(tmpstr), "CAM CD unit %d", periph->unit_number); > snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); > > - mtx_lock(&Giant); > - > sysctl_ctx_init(&softc->sysctl_ctx); > softc->flags |= CD_FLAG_SCTX_INIT; > softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, > @@ -565,7 +563,6 @@ > > if (softc->sysctl_tree == NULL) { > printf("cdsysctlinit: unable to allocate sysctl tree\n"); > - mtx_unlock(&Giant); > cam_periph_release(periph); > return; > } > @@ -579,7 +576,6 @@ > &softc->minimum_command_size, 0, cdcmdsizesysctl, "I", > "Minimum CDB size"); > > - mtx_unlock(&Giant); > cam_periph_release(periph); > } > > > thnx! > > roman > -- John Baldwin