From owner-freebsd-arch@FreeBSD.ORG Sun Aug 19 08:40:30 2007 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E66016A417 for ; Sun, 19 Aug 2007 08:40:30 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.freebsd.org (Postfix) with ESMTP id B164213C459 for ; Sun, 19 Aug 2007 08:40:29 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id AECBA45696; Sun, 19 Aug 2007 10:40:27 +0200 (CEST) Received: from localhost (154.81.datacomsa.pl [195.34.81.154]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 1C95245681 for ; Sun, 19 Aug 2007 10:40:21 +0200 (CEST) Date: Sun, 19 Aug 2007 10:39:22 +0200 From: Pawel Jakub Dawidek To: freebsd-arch@FreeBSD.org Message-ID: <20070819083922.GC11792@garage.freebsd.pl> References: <20070818120056.GA6498@garage.freebsd.pl> <20070818220756.GH6498@garage.freebsd.pl> <20070818230917.GI6498@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s9fJI615cBHmzTOP" Content-Disposition: inline In-Reply-To: <20070818230917.GI6498@garage.freebsd.pl> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: Subject: Re: Lockless uidinfo. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2007 08:40:30 -0000 --s9fJI615cBHmzTOP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 19, 2007 at 01:09:17AM +0200, Pawel Jakub Dawidek wrote: > Ok, after implementing atomic_fetchadd_long() on amd64, we get additional > 6% of performance improvement: >=20 > x ./uidinfo_lockfree.txt (atomic_cmpset_long loop) > + ./uidinfo_waitfree.txt (atomic_fetchadd_long) > +------------------------------------------------------------------------= ------+ > | = +| > | = +| > |x xx xx = + ++| > | |__MA___| = |AM| > +------------------------------------------------------------------------= ------+ > N Min Max Median Avg Stdd= ev > x 5 1561566 1575987 1568964 1569767 5853.13= 99 > + 5 1662362 1665936 1665810 1664881.8 1541.26= 93 > Difference at 95.0% confidence > 95114.8 +/- 6241.96 > 6.05917% +/- 0.397636% > (Student's t, pooled s =3D 4279.88) One more thing - comparsion between waitfree method and when chgsbsize() is a no-op: x ./uidinfo_waitfree.txt (atomic_fetchadd_long) + ./uidinfo_none.txt (no chgsbsize) +--------------------------------------------------------------------------= ----+ |x xx + + + + = +| | |AM| |_______M_A________| = | +--------------------------------------------------------------------------= ----+ N Min Max Median Avg Stddev x 5 1662362 1665936 1665810 1664881.8 1541.2693 + 5 1718287 1744448 1726343 1728176.6 10271.936 Difference at 95.0% confidence 63294.8 +/- 10711.8 3.80176% +/- 0.643395% (Student's t, pooled s =3D 7344.66) This small speed up is of course because of atomics in waitfree case, but it shows that we can't do much better than waitfree version, as ideal case is = only 3.8% faster, at least for this benchmark. This was for eight processes and this is for one: x ./uidinfo_up_waitfree.txt (atomic_fetchadd_long) + ./uidinfo_up_none.txt (no chgsbsize) +--------------------------------------------------------------------------= ----+ |x x x x x + += +++| | |______________M_____A_____________________| |_= AM_|| +--------------------------------------------------------------------------= ----+ N Min Max Median Avg Stddev x 5 419799 431017 422877 424180.2 4265.4168 + 5 433705 434955 434696 434509.6 519.68 Difference at 95.0% confidence 10329.4 +/- 4431.34 2.43514% +/- 1.04468% (Student's t, pooled s =3D 3038.41) This means that something else slows that eight processes case a bit, but i= t's not uidinfo. Ok, I need to stop, I need to stop right now! --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --s9fJI615cBHmzTOP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFGyAG6ForvXbEpPzQRApYVAJ4oNRlFeOzCQHM6N1WtncBklkaQywCggSaK Afv4wV9jNZHRESumApJeqNg= =0DHg -----END PGP SIGNATURE----- --s9fJI615cBHmzTOP--