Date: Mon, 26 Nov 2007 10:18:30 +0000 (GMT) From: Robert Watson <rwatson@FreeBSD.org> To: Alfred Perlstein <alfred@freebsd.org> Cc: src-committers@freebsd.org, cvs-src@freebsd.org, cvs-all@freebsd.org, Daniel Eischen <deischen@freebsd.org>, Julian Elischer <julian@elischer.org>, Stephan Uphoff <ups@freebsd.org> 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 Message-ID: <20071126101647.E65286@fledge.watson.org> In-Reply-To: <20071126012856.GZ71382@elvis.mu.org> References: <200711081447.lA8EltXO052057@repoman.freebsd.org> <47492064.7080108@freebsd.org> <Pine.GSO.4.64.0711251207590.8538@sea.ntplx.net> <4749B971.3000703@elischer.org> <20071126012856.GZ71382@elvis.mu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 25 Nov 2007, Alfred Perlstein wrote: > * Julian Elischer <julian@elischer.org> [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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071126101647.E65286>