From owner-cvs-all@FreeBSD.ORG Sat Mar 31 23:23:42 2007 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DCF9216A401; Sat, 31 Mar 2007 23:23:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id CCF0F13C46C; Sat, 31 Mar 2007 23:23:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l2VNNghY006392; Sat, 31 Mar 2007 23:23:42 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l2VNNgPb006391; Sat, 31 Mar 2007 23:23:42 GMT (envelope-from jhb) Message-Id: <200703312323.l2VNNgPb006391@repoman.freebsd.org> From: John Baldwin Date: Sat, 31 Mar 2007 23:23:42 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/share/man/man9 Makefile sx.9 src/sys/conf NOTES options src/sys/dev/acpica acpi_ec.c src/sys/dev/mxge if_mxge.c src/sys/dev/usb if_aue.c if_axe.c src/sys/gnu/fs/xfs/FreeBSD/support mrlock.c mrlock.h ... X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Mar 2007 23:23:43 -0000 jhb 2007-03-31 23:23:42 UTC FreeBSD src repository Modified files: share/man/man9 Makefile sx.9 sys/conf NOTES options sys/dev/acpica acpi_ec.c sys/dev/mxge if_mxge.c sys/dev/usb if_aue.c if_axe.c sys/gnu/fs/xfs/FreeBSD/support mrlock.c mrlock.h sys/i386/acpica acpi_machdep.c sys/kern kern_sx.c sys/netinet6 in6_src.c sys/sys sleepqueue.h sx.h Added files: sys/sys _sx.h Log: Optimize sx locks to use simple atomic operations for the common cases of obtaining and releasing shared and exclusive locks. The algorithms for manipulating the lock cookie are very similar to that rwlocks. This patch also adds support for exclusive locks using the same algorithm as mutexes. A new sx_init_flags() function has been added so that optional flags can be specified to alter a given locks behavior. The flags include SX_DUPOK, SX_NOWITNESS, SX_NOPROFILE, and SX_QUITE which are all identical in nature to the similar flags for mutexes. Adaptive spinning on select locks may be enabled by enabling the ADAPTIVE_SX kernel option. Only locks initialized with the SX_ADAPTIVESPIN flag via sx_init_flags() will adaptively spin. The common cases for sx_slock(), sx_sunlock(), sx_xlock(), and sx_xunlock() are now performed inline in non-debug kernels. As a result, now requires to be included prior to . The new kernel option SX_NOINLINE can be used to disable the aforementioned inlining in non-debug kernels. The size of struct sx has changed, so the kernel ABI is probably greatly disturbed. MFC after: 1 month Submitted by: attilio Tested by: kris, pjd Revision Changes Path 1.305 +1 -0 src/share/man/man9/Makefile 1.38 +58 -4 src/share/man/man9/sx.9 1.1417 +13 -0 src/sys/conf/NOTES 1.584 +2 -0 src/sys/conf/options 1.73 +1 -0 src/sys/dev/acpica/acpi_ec.c 1.25 +1 -0 src/sys/dev/mxge/if_mxge.c 1.107 +1 -0 src/sys/dev/usb/if_aue.c 1.42 +1 -0 src/sys/dev/usb/if_axe.c 1.2 +8 -43 src/sys/gnu/fs/xfs/FreeBSD/support/mrlock.c 1.2 +12 -36 src/sys/gnu/fs/xfs/FreeBSD/support/mrlock.h 1.35 +1 -0 src/sys/i386/acpica/acpi_machdep.c 1.40 +681 -229 src/sys/kern/kern_sx.c 1.42 +1 -0 src/sys/netinet6/in6_src.c 1.1 +43 -0 src/sys/sys/_sx.h (new) 1.12 +4 -2 src/sys/sys/sleepqueue.h 1.29 +168 -18 src/sys/sys/sx.h