From owner-cvs-all@FreeBSD.ORG Mon Nov 26 10:18:53 2007 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1535B16A468; Mon, 26 Nov 2007 10:18:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id C89E813C4D5; Mon, 26 Nov 2007 10:18:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 8A6AB470C3; Mon, 26 Nov 2007 05:22:10 -0500 (EST) Date: Mon, 26 Nov 2007 10:18:30 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alfred Perlstein In-Reply-To: <20071126012856.GZ71382@elvis.mu.org> Message-ID: <20071126101647.E65286@fledge.watson.org> References: <200711081447.lA8EltXO052057@repoman.freebsd.org> <47492064.7080108@freebsd.org> <4749B971.3000703@elischer.org> <20071126012856.GZ71382@elvis.mu.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, cvs-src@freebsd.org, cvs-all@freebsd.org, Daniel Eischen , Julian Elischer , Stephan Uphoff Subject: Re: cvs commit: src/share/man/man9 locking.9 rmlock.9 src/sys/conf files src/sys/kern kern_rmlock.c subr_lock.c subr_pcpu.c subr_smp.c src/sys/sys _rmlock.h lock.h pcpu.h rmlock.h smp.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: Mon, 26 Nov 2007 10:18:53 -0000 On Sun, 25 Nov 2007, Alfred Perlstein wrote: > * Julian Elischer [071125 10:05] wrote: >> >> not sure why sx-locks exist at all, as they seem to be a variant of sleep. >> I think it's just a convenience function set to allow one to implement a >> sleep-derived synchronisation. > > You are correct, sx locks are a faster replacement for hand rolled msleep > locks. They're not only easier to read, but the underlying implementation > is faster. We shouldn't under-emphasize the performance point: sx(9) locks instead of a hand-rolled msleep(9) lock for struct filedesc are one of the most important performance improvements in 7.0, and responsible for a large part of the MySQL improvement. A big part of the improvement is avoiding nasty thundering herd behavior when there's contention. Likewise, moving to sx(9) instead of hand-rolled msleep(9) locks in the socket buffer code made a noticeable difference in performance as well, although the thundering herd there was much less of a problem. Robert N M Watson Computer Laboratory University of Cambridge