From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 17:00:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E62B1065694; Tue, 10 Mar 2009 17:00:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C68D8FC08; Tue, 10 Mar 2009 17:00:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2AH0TvG068114; Tue, 10 Mar 2009 17:00:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2AH0T5l068113; Tue, 10 Mar 2009 17:00:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903101700.n2AH0T5l068113@svn.freebsd.org> From: John Baldwin Date: Tue, 10 Mar 2009 17:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189631 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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, 10 Mar 2009 17:00:30 -0000 Author: jhb Date: Tue Mar 10 17:00:28 2009 New Revision: 189631 URL: http://svn.freebsd.org/changeset/base/189631 Log: - Remove a recently added comment from kernel_sysctlbyname() that isn't needed. - Move the release of the sysctl sx lock after the vsunlock() in userland_sysctl() to restore the original memlock behavior of minimizing the amount of memory wired to handle sysctl requests. MFC after: 1 week Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Tue Mar 10 16:42:49 2009 (r189630) +++ head/sys/kern/kern_sysctl.c Tue Mar 10 17:00:28 2009 (r189631) @@ -1200,14 +1200,6 @@ kernel_sysctlbyname(struct thread *td, c oid[1] = 3; /* name2oid */ oidlen = sizeof(oid); - /* - * XXX: Prone to a possible race condition between lookup and - * execution? Maybe put locking around it? - * - * Userland is just as racy, so I think the current implementation - * is fine. - */ - error = kernel_sysctl(td, oid, 2, oid, &oidlen, (void *)name, strlen(name), &plen, flags); if (error) @@ -1520,10 +1512,10 @@ userland_sysctl(struct thread *td, int * } CURVNET_RESTORE(); - SYSCTL_XUNLOCK(); if (req.lock == REQ_WIRED && req.validlen > 0) vsunlock(req.oldptr, req.validlen); + SYSCTL_XUNLOCK(); if (error && error != ENOMEM) return (error);