From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FB69C54EBD for ; Mon, 9 Jan 2023 21:39:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbjAIVi7 (ORCPT ); Mon, 9 Jan 2023 16:38:59 -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) 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