From owner-svn-src-head@FreeBSD.ORG Mon May 18 12:03:43 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 D18751065748; Mon, 18 May 2009 12:03:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B185E8FC1D; Mon, 18 May 2009 12:03:43 +0000 (UTC) (envelope-from ed@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 n4IC3hwS061369; Mon, 18 May 2009 12:03:43 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4IC3hwc061368; Mon, 18 May 2009 12:03:43 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200905181203.n4IC3hwc061368@svn.freebsd.org> From: Ed Schouten Date: Mon, 18 May 2009 12:03:43 +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: r192304 - 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: Mon, 18 May 2009 12:04:02 -0000 Author: ed Date: Mon May 18 12:03:43 2009 New Revision: 192304 URL: http://svn.freebsd.org/changeset/base/192304 Log: Mark the clock sysctls as MPSAFE. These sysctls don't need any form of locking. At least cp_times is used by powerd very often, which means I get 50% less calls to non-MPSAFE sysctls on my system. The other 50% is consumed by dev.cpu.0.freq, but this seems to need Giant for Newbus. Modified: head/sys/kern/kern_clock.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Mon May 18 11:23:15 2009 (r192303) +++ head/sys/kern/kern_clock.c Mon May 18 12:03:43 2009 (r192304) @@ -112,7 +112,7 @@ sysctl_kern_cp_time(SYSCTL_HANDLER_ARGS) return error; } -SYSCTL_PROC(_kern, OID_AUTO, cp_time, CTLTYPE_LONG|CTLFLAG_RD, +SYSCTL_PROC(_kern, OID_AUTO, cp_time, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE, 0,0, sysctl_kern_cp_time, "LU", "CPU time statistics"); static long empty[CPUSTATES]; @@ -156,7 +156,7 @@ sysctl_kern_cp_times(SYSCTL_HANDLER_ARGS return error; } -SYSCTL_PROC(_kern, OID_AUTO, cp_times, CTLTYPE_LONG|CTLFLAG_RD, +SYSCTL_PROC(_kern, OID_AUTO, cp_times, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE, 0,0, sysctl_kern_cp_times, "LU", "per-CPU time statistics"); void @@ -559,7 +559,8 @@ sysctl_kern_clockrate(SYSCTL_HANDLER_ARG return (sysctl_handle_opaque(oidp, &clkinfo, sizeof clkinfo, req)); } -SYSCTL_PROC(_kern, KERN_CLOCKRATE, clockrate, CTLTYPE_STRUCT|CTLFLAG_RD, +SYSCTL_PROC(_kern, KERN_CLOCKRATE, clockrate, + CTLTYPE_STRUCT|CTLFLAG_RD|CTLFLAG_MPSAFE, 0, 0, sysctl_kern_clockrate, "S,clockinfo", "Rate and period of various kernel clocks");