Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6873715rwl; Mon, 9 Jan 2023 14:22:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXu76XkJb/uMpVMYeGZ/iLxm8G47Zg2kGCeOrO/Yj8zTCxzBt6mOp1z5AphVfcVcAtjAdwzM X-Received: by 2002:a17:906:f0ca:b0:84d:3e5b:7c02 with SMTP id dk10-20020a170906f0ca00b0084d3e5b7c02mr5659708ejb.22.1673302971078; Mon, 09 Jan 2023 14:22:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673302971; cv=none; d=google.com; s=arc-20160816; b=yH1OL0QDhWtCi5BdmPsihY8czK93fjVUdFARMOaY8BEvQwPVoKIXYy/mr+lrpiXSdA t+yqB67zTz/J8AxkIzyrefJ6M8zr/OFJ+CiYHI0sqRJPLPbT2wfSUaJvggbAmBnmNoX6 7FASqeA5Og2ULPPILdocgfJ/rFunq5bb7vAyVUceTnWUwxodevgFO2ypICOMDGcp9Rww gp6n1DGxHju7ujBawoyt+rIgbDXK6GGLgkGJDENxnKDbyELhBVdeESGfyF8U8UoB0K1L T7aD+mpfMTVxrq0alRFv4HPK4P5VekGVrH1lHXt3fxeZbtZnx3JX4r+wDq5druplOSRE 70nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:message-id:subject:cc:to:from:date; bh=F/ozJ1ZPB3/H27+85trdHWDws3ZM2JYUJBJ94lgSM/A=; b=ZPNrcgFA4hJOaIOerU92uRzCAhwZKaUATiukBueMzll9rPDNEhT3WybEkpte3tvw17 g/wb2j3Zc4OEv2yzkiz2ujVDRrlTAYXnb8LVaDp9PGfkmLAmzHK83eGWtPkcnOf8GoJZ BpMQfZ0Cc40/V7rzDMcuii11E3fqTDjhtU154NJ8i/IsTf7WDXxMzdQr4mxmA9KwgZM4 /TPBM8ECeus8Q518g39eQPIRmpC2TALTuicbNTbLR4o1w/kVFnnSeNUftFr7Bn9OnB0A QOTU+owwW/MHcLsd42JPVTRAG80q+1LlF4rwSF+6iGSVlb9bROfi2sxjVgzKVoF748qc e1GA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ss4-20020a170907c00400b007e9516bc01dsi8689353ejc.212.2023.01.09.14.22.38; Mon, 09 Jan 2023 14:22:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238098AbjAIVi6 (ORCPT + 53 others); Mon, 9 Jan 2023 16:38:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238192AbjAIVih (ORCPT ); Mon, 9 Jan 2023 16:38:37 -0500 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8C8DE3C71C for ; Mon, 9 Jan 2023 13:36:48 -0800 (PST) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 309LadgB031856; Mon, 9 Jan 2023 22:36:39 +0100 Date: Mon, 9 Jan 2023 22:36:39 +0100 From: Willy Tarreau To: Geert Uytterhoeven Cc: "Theodore Ts'o" , Pavel Machek , kernel list , Andrew Morton Subject: Re: Dhrystone -- userland version Message-ID: <20230109213639.GA31782@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,FAKE_REPLY_C, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, On Mon, Jan 09, 2023 at 08:36:39PM +0100, Geert Uytterhoeven wrote: > Seeing the rdtsc stuff, I was a bit skeptical, but it seems to work > fine on arm32 and rv64. Yes, I'm using it on arm32/64, mips, i386/x86_64, ppc64. It always works fine. The rdtsc stuff you saw is not there to perform the measurements, it's the opposite, the tool is measuring the TSC's frequency when there is one :-) > Unfortunately you forgot to add a LICENSE file ;-) I really don't care. It can be public domain or MIT (since in many places you can't drop your own rights and put something into public domain). If you need anything from it, feel free to steal code from it, I'm fine with this. > Alternatively, I can use the C version of BogoMIPS. Which has its > own merits and reputation. Yes, it's just that you have to apply your own ratios depending on the build options and arch if you want to find the frequency. > The nice thing about Dhrystones is that people still publish numbers > for comparison, also DMIPS/MHz and DMIPS/mW. Yes that's true, but the numbers can differ by orders of magnitude on the same hardware depending on build options, it's hard to compare anything using it these days. > Gcc 4.1.2 (still the userspace compiler on a few of my old systems) > doesn't like the aligned() attribute on functions. Good to know, thank you. We could enclose it between ifdefs if needed. > In glibc 2.3, LLONG_MAX is defined conditionally on __USE_ISOC99. Yes or the usual (~0ULL)/2 should work and be equally portable. > Apart from that, the result is fairly accurate. Nice job! Actually it's not the tool that's accurate, it's gettimeofday() ;-) Cheers, Willy