From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6969 Path: news.gmane.org!not-for-mail From: Denys Vlasenko Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: [PATCH] x86_64/memset: simple optimizations Date: Tue, 10 Feb 2015 21:52:54 +0100 Message-ID: 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=UTF-8 X-Trace: ger.gmane.org 1423601614 22491 80.91.229.3 (10 Feb 2015 20:53:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Feb 2015 20:53:34 +0000 (UTC) To: musl Original-X-From: musl-return-6982-gllmg-musl=m.gmane.org@lists.openwall.com Tue Feb 10 21:53:28 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 1YLHoF-0008Fr-S8 for gllmg-musl@m.gmane.org; Tue, 10 Feb 2015 21:53:27 +0100 Original-Received: (qmail 19556 invoked by uid 550); 10 Feb 2015 20:53:26 -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 19545 invoked from network); 10 Feb 2015 20:53:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=aEcWM3V4wSOZq6v50/UG5oFWabD5PXAKsJhx8+RXobo=; b=l4bWnjP+eHrnMKREmsVBiXvn8arQswTxhJPxfKj4n7ntJmhzdVl1xVbwvGjODHVs8v W+gzBY7Jo+z8AsfjgyFGzUyCBzV6v1+zlS5Uczd76vVU7EiTmJhmMzNO8MDj49MFlidS T8ns52DlQXR6gHJZl1vxugXrvue9UolxJuINVuhzKDHEwpH1WSfxNXAEtm2z47Shy2RY VohRr3DFz69NONkrnogo/GW8/5eMO+jL6qBSv8A0MvmEZCNFFFjF8WWa/rOSHgUm8GMy YwCZDEzyJD6q+ZUy4RSuUDIIA8mSTdVcNLnVHknuAkWMiZ5lj7O15eVgm4hhJFPBGUzu GTwQ== X-Received: by 10.140.93.73 with SMTP id c67mr19315948qge.53.1423601594554; Tue, 10 Feb 2015 12:53:14 -0800 (PST) In-Reply-To: <20150210204342.GJ23507@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:6969 Archived-At: 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.