From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 23:26:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F061C5BF; Tue, 25 Mar 2014 23:26:54 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 19A2A2DD; Tue, 25 Mar 2014 23:26:53 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id b13so703252wgh.17 for ; Tue, 25 Mar 2014 16:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=bZbVAIjrmabKKcOD4b7JdJzI63ol+tRcwQuGTyUPHRY=; b=ZHNFmmLernJOxhQ5CkQnmdpdrXj3D5IYxFFhkIXXB4lykaxcGfcIlFzs00AUy7U3P2 SH20TUWC5Z/DdyrmwUyowyBT7tUujRFHVEZI8HOJOaW059NFtZnt1YwIvcWTXqLz6Whu RwiGh+Q82Ef0bHrbiHkhY+jCCgNCVpmPjTlAfWO48z1uhqswRZBZ+2M6pFSbMyQuaLnk +HBb71gAf4RiZp/+LbfGPdZdgbE8dWAvNICX/eT9OTvy811VwmRKMcAfAVc/oILKalWe i/ssbPXUziGynCMPGBytmCSo0B2se/Wiw8pM+XVUSqlAd0k6+soJkwBNyLi1u62CBeee XZFg== X-Received: by 10.180.188.66 with SMTP id fy2mr25359279wic.45.1395790012512; Tue, 25 Mar 2014 16:26:52 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id qg3sm54626787wic.10.2014.03.25.16.26.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 25 Mar 2014 16:26:51 -0700 (PDT) Date: Wed, 26 Mar 2014 00:26:48 +0100 From: Mateusz Guzik To: Warner Losh Subject: Re: svn commit: r263704 - head/sys/kern Message-ID: <20140325232648.GA19412@dft-labs.eu> References: <201403250328.s2P3Swsl054558@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 23:26:55 -0000 On Tue, Mar 25, 2014 at 08:03:13AM -0600, Warner Losh wrote: > On Mar 24, 2014, at 9:28 PM, Mateusz Guzik wrote: > > Author: mjg > > Date: Tue Mar 25 03:28:58 2014 > > New Revision: 263704 > > URL: http://svnweb.freebsd.org/changeset/base/263704 > > > > Log: > > Make /dev/devctl mpsafe. > > > > MFC after: 1 week > > > > static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS); > > /* XXX Need to support old-style tunable hw.bus.devctl_disable" */ > > -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW, NULL, > > - 0, sysctl_devctl_disable, "I", "devctl disable -- deprecated"); > > +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW | > > + CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_disable, "I", > > + "devctl disable -- deprecated”); > > This can likely be deleted now... > http://svnweb.freebsd.org/changeset/base/263754 > > @@ -420,23 +420,31 @@ devinit(void) > > static int > > devopen(struct cdev *dev, int oflags, int devtype, struct thread *td) > > { > > + > > if (devsoftc.inuse) > > return (EBUSY); > > Why not delete these two lines? Since this isn’t a performance critical part of the code, > it is clearer and safer to just test inuse inside the locked section. > http://svnweb.freebsd.org/changeset/base/263753 -- Mateusz Guzik