From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6970 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: [PATCH] x86_64/memset: simple optimizations Date: Tue, 10 Feb 2015 15:54:58 -0500 Message-ID: <20150210205458.GL23507@brightrain.aerifal.cx> References: <1423258814-9045-1-git-send-email-vda.linux@googlemail.com> <20150207003535.GS23507@brightrain.aerifal.cx> <20150207130655.GW23507@brightrain.aerifal.cx> <20150210204342.GJ23507@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1423601715 24410 80.91.229.3 (10 Feb 2015 20:55:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Feb 2015 20:55:15 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6983-gllmg-musl=m.gmane.org@lists.openwall.com Tue Feb 10 21:55:15 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YLHpw-0000aQ-Hs for gllmg-musl@m.gmane.org; Tue, 10 Feb 2015 21:55:12 +0100 Original-Received: (qmail 20314 invoked by uid 550); 10 Feb 2015 20:55:11 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 20306 invoked from network); 10 Feb 2015 20:55:10 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:6970 Archived-At: On Tue, Feb 10, 2015 at 09:52:54PM +0100, Denys Vlasenko wrote: > On Tue, Feb 10, 2015 at 9:43 PM, Rich Felker wrote: > > On Tue, Feb 10, 2015 at 09:27:17PM +0100, Denys Vlasenko wrote: > >> On Sat, Feb 7, 2015 at 2:06 PM, Rich Felker wrote: > >> /* libc has incredibly messy way of doing this, > >> * typically requiring -lrt. We just skip all this mess */ > >> static void get_mono(struct timespec *ts) > >> { > >> syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts); > >> } > > > > FWIW, this is a bad idea; you get syscall overhead in your > > measurements. If you just use clock_gettime (the function) you'll get > > vdso results (no syscall). > > I repeat memset 32 times between reading timespamp. > Thus, even with "small" 20kb memset test > there are 640kb of writes to L1. This is bit enough > to make overhead insignificant. Yes, I agree it's probably okay the way you've structured the test here; that's why I mentioned it as a "FWIW" rather than an objection to the results. It was more an aside remark about how this technique could be problematic in the future. Sorry for not being clear. Rich