Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8321389rwp; Wed, 19 Jul 2023 08:15:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlFhp/OLCv2xKifvrSoD3aqcoVfer/j9j3Wm8mpmEf8WXISi6OR/sIriuKyZEp/iBiaCyfC5 X-Received: by 2002:a19:3843:0:b0:4f1:4cdc:ec03 with SMTP id d3-20020a193843000000b004f14cdcec03mr141739lfj.18.1689779719910; Wed, 19 Jul 2023 08:15:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689779719; cv=none; d=google.com; s=arc-20160816; b=klv1I56pHfGYc3hKrMK5XxuLCK0gV77SmKJiT3yQh3RZmLxPVJ23Bw3EHH5WBo18yT Q4zpFryzVRHQOY5hJ5DrFnP75XagPBpbqRzcv6CaqTBcSNfDQc2OfATxYhPMEpQYmrkp ytMPaQFxHB+juCGaYVv9EVodDFZJOz9pyin0PEXL/T6GGFrtYy8UqFSQvJdO4ULmUovw OQ3vxFWNYe19bxkUAeFBF0lkrIs4cW5n/2rpom3y5tGEE7J1No1QQv5zagZPpclMqT01 4oJAltqtTRODfPgHvjiz/2d8a2vZrgZP+xtJOvPUYuwxQR37PYZhPdUuCYEwhIe6bU+c JIFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from; bh=Ewh3OyeU8zpEHQJafDp7SYovD+kx6D94xKkIAMaXxGQ=; fh=wp15ZNyxPvNMjcP33Y2pwiJZM1kLFa18TWPcx/EaFgI=; b=UpWZkHZseAUbO+oRotyP4ljVFMTtMwRcxXHqKo30P/oRo93ILUnqjN548gPflWoouf XaasEeSlxHKE7bz70yTWpKYnwQatT6ZsulrkaCEQ6XKC54jgzJfMVtwyWgwnF8dTt4FT P9mcGy3J+KTNA/122T5YEZ2fqkyIwy15TArJKPyaAyCHI4s60EqtbQqen8JRAadMnD4o sQVIEXQwbyyOtpnpMkxr8sDiQgTGXmBRTpait1LOQPabjepQYguL5AO5Kq5W/4gWSfYJ mxo5R9RqeKOU1ufjE/Ni7BPin1QTBxR9ayt3N96DW0RossYGx6byyQWqRskoJ48ClrxE jHYQ== 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 c5-20020aa7df05000000b00514a4541769si3121960edy.81.2023.07.19.08.14.54; Wed, 19 Jul 2023 08:15:19 -0700 (PDT) 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 S229673AbjGSOyc convert rfc822-to-8bit (ORCPT + 99 others); Wed, 19 Jul 2023 10:54:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231342AbjGSOyD (ORCPT ); Wed, 19 Jul 2023 10:54:03 -0400 Received: from 6.mo575.mail-out.ovh.net (6.mo575.mail-out.ovh.net [46.105.63.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92AFF1722 for ; Wed, 19 Jul 2023 07:54:01 -0700 (PDT) Received: from director8.ghost.mail-out.ovh.net (unknown [10.108.1.240]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 3EBA92701E for ; Wed, 19 Jul 2023 14:46:00 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-vmrfz (unknown [10.110.171.117]) by director8.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 12A6A1FD18; Wed, 19 Jul 2023 14:45:58 +0000 (UTC) Received: from courmont.net ([37.59.142.106]) by ghost-submission-6684bf9d7b-vmrfz with ESMTPSA id hQaDOib3t2TqZgAAVw4Xwg (envelope-from ); Wed, 19 Jul 2023 14:45:58 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-106R006f1f5ee59-9d59-4f77-aa40-2a724a7ea83b, EAC8E2D8683B439879DFB44EAE753B92CD951686) smtp.auth=postmaster@courmont.net X-OVh-ClientIp: 87.92.194.88 From: =?ISO-8859-1?Q?R=E9mi?= Denis-Courmont To: Atish Patra Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Aurelien Jarno , Mathieu Malaterre , Jan Newger Subject: Re: [PATCH v4 00/10] riscv: Allow userspace to directly access perf counters Date: Wed, 19 Jul 2023 17:45:57 +0300 Message-ID: <5951331.lOV4Wx5bFT@basile.remlab.net> Organization: Remlab In-Reply-To: References: <20230703124647.215952-1-alexghiti@rivosinc.com> <8756384.Zvl9fuB8X0@basile.remlab.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="UTF-8" X-Ovh-Tracer-Id: 17809484729600317882 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrgeekgdeigecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfhojghfggfgtgesthhqredttddtjeenucfhrhhomheptformhhiucffvghnihhsqdevohhurhhmohhnthcuoehrvghmihesrhgvmhhlrggsrdhnvghtqeenucggtffrrghtthgvrhhnpeeuhfegfeefvdefueetleefffduuedvjeefheduueekieeltdetueetueeugfevffenucffohhmrghinheprhgvmhhlrggsrdhnvghtnecukfhppeduvdejrddtrddtrddupdekjedrledvrdduleegrdekkedpfeejrdehledrudegvddruddtieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehrvghmihesrhgvmhhlrggsrdhnvghtqedpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheejhedpmhhouggvpehsmhhtphhouhht X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Le keskiviikkona 19. heinäkuuta 2023, 1.48.49 EEST Atish Patra a écrit : > > Isn't RDTIM susceptible to interference from power management and CPU > > frequency scaling? I suppose that RDCYCLE may behave differently depending > > on PM in *some* designs, but that would still be way better than RDTIME > > for the purpose. > > Yes. But that's what it is probably using for other ISAs ? At least on AArch64, it is using either Linux perf cycle counter, or if that is disabled at build time, the raw PMU cycle counter - which obviously leads to SIGILL on Linux, just like this MR would do with RDCYCLE. Again, I do not *personally* have objections to disabling RDCYCLE for userspace (somebody else does, but that's neither my nor your problem). I do have objections to the wording of some of the commit messages though. > My point was it should just do whatever it does for other ISA. RISC-V is no > special in that regard. Sure. My point is that RDTIME may be great for, so to say, system-level benchmarks. For FFmpeg that could something like how long it takes to transcode a video. But it doesn't seem to make much sense for microbenchmarking of single threaded tightly optimised loops, as opposed to RDCYCLE (or a wrapper for RDCYCLE). -- Rémi Denis-Courmont http://www.remlab.net/