From owner-svn-src-all@freebsd.org Thu Jun 7 13:27:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7CA6FE7903; Thu, 7 Jun 2018 13:27:39 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B45C868AC4; Thu, 7 Jun 2018 13:27:39 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 8076D5A9F12; Thu, 7 Jun 2018 13:27:33 +0000 (UTC) Date: Thu, 7 Jun 2018 13:27:33 +0000 From: Brooks Davis To: Ravi Pokala Cc: "Jonathan T. Looney" , Mateusz Guzik , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334702 - head/sys/sys Message-ID: <20180607132733.GA41876@spindle.one-eyed-alien.net> References: <201806060508.w56586c9053686@repo.freebsd.org> <6E6E92B2-7536-4281-8EAF-72823E84902E@panasas.com> <47E06039-234C-4078-A732-BFF230D2472B@panasas.com> <468B8AB5-D2C7-4033-9F24-6E1F94DC7137@panasas.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline In-Reply-To: <468B8AB5-D2C7-4033-9F24-6E1F94DC7137@panasas.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 13:27:40 -0000 --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 07, 2018 at 12:01:00AM -0400, Ravi Pokala wrote: > > I believe the theory is that the compiler (remember, this is __builtin_= memset) can optimize away portions of the zeroing, or can optimize zeroing = for small sizes. >=20 > Ahhh! I didn't consider that the compiler would be doing analysis of the = larger context, and potentially skipping zeroing parts that are set immedia= tely after the call. Clang does this. It does make for some quite interesting object code, but the result is that zeroing with __builtin_memset() is basically free for mostly-initialized structures. -- Brooks --ikeVEW9yuYc//A+q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJbGTLEAAoJEKzQXbSebgfA8cIH/RlCwFDXLPa31BCS4XMjzqxJ /31i3IEKOH7/4aQHxlf58rquy6xAi1w3nI0bLavyCU/9BFoJeAvwat1UkdVCK92x 6z3tdOP0XUK2hAJidT1T4/lgWT8VbRERnGOnQseL2fSV9Cb64PDkP6RLB1lEVBTE I4XzEM6oHOu5q6H74z2DDH4R0pNO1LU2K35pm4M4QTYGW5DWV7sXtnTzUONjnO07 6XSV8B/jFNiTUNEqY81o9jkcpk6ocCPKDsgIjwym6hDbEGrVrSmJFw6oDzoLoPI+ wkwMh1LDtm07VxgD5n8wt7RjUb/2a79GuQ/AcZhstzvnZekBP8iyGBJSXBgvJF0= =rAJw -----END PGP SIGNATURE----- --ikeVEW9yuYc//A+q--