From owner-svn-src-all@freebsd.org Thu Jun 7 13:52:08 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 9AE62FE9B22; Thu, 7 Jun 2018 13:52:08 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 501296A4BA; Thu, 7 Jun 2018 13:52:08 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [10.200.7.59] (unknown [137.122.64.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id DF85DF536; Thu, 7 Jun 2018 13:52:07 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.d.1.180523 Date: Thu, 07 Jun 2018 09:52:06 -0400 Subject: Re: svn commit: r334702 - head/sys/sys From: Ravi Pokala To: Brooks Davis CC: "Jonathan T. Looney" , Mateusz Guzik , Mateusz Guzik , src-committers , , Message-ID: <505A6291-6B3C-4857-8A9C-60E58EB50454@panasas.com> Thread-Topic: svn commit: r334702 - head/sys/sys 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> <20180607132733.GA41876@spindle.one-eyed-alien.net> In-Reply-To: <20180607132733.GA41876@spindle.one-eyed-alien.net> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit 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:52:08 -0000 -----Original Message----- From: Brooks Davis Date: 2018-06-07, Thursday at 09:27 To: Ravi Pokala Cc: "Jonathan T. Looney" , Mateusz Guzik , Mateusz Guzik , src-committers , , Subject: Re: svn commit: r334702 - head/sys/sys > 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. >> >> Ahhh! I didn't consider that the compiler would be doing analysis of the larger context, and potentially skipping zeroing parts that are set immediately 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 Yeah, it's a subtle but obvious optimization in hindsight. Thanks for the info. -Ravi (rpokala@)