Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9286747rwp; Thu, 20 Jul 2023 02:31:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlFG5TMV/Ho10qRU+DZ4DpUsHnjfcsbrofaxZDUemLJldSxrbC8X+gm1Fl014Z4IsdgEguQz X-Received: by 2002:a17:902:e812:b0:1b8:3936:7b64 with SMTP id u18-20020a170902e81200b001b839367b64mr6761529plg.1.1689845489658; Thu, 20 Jul 2023 02:31:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689845489; cv=none; d=google.com; s=arc-20160816; b=fosWa8XLaI/FdxIweMcLY/q/7vTbHVs8Fn2lGaOC4dM5Vc3sqLAJWfeyWIGKeLfJib a6WEhEmgKd+5XxO7pAQVTTN2IzwDGDzqESHODl70zbxa/rRaxFIOWYWozqIHu8o6YBUt BkHdrLiuBcfaCbr+xJAOyV7ld1ZZcEQIxrToSIyqiSqCT6nLicxjFPKfZjorKlhNkUoE igUrHOt53JrtKxAEwb1z/aNtxTab1qjdenIUhdtVx/S+GAyTXcQ0aHVW2T3iNTYx2/E9 5IAzKSo9ZAZ/1lTten/rFC+/8OL6wLTM+DW0BukCshEix5QpqoBopsoOO/NiFQfI2sbR kSyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=8a2cylxKIis3s/i4JRLYyyrf1Wj1eGxpkUn0BjM0mVA=; fh=3U7i4EnPPj3nZni6HTD5MZKeABmwh5Q46bKOOfSRljE=; b=tcv9o7fntGDFVPcbkEmW5NsbM+9J5Fo+9L8bfgGSUhLW76HyQzHY6EqRU/VYEKA7Vb XIcXNXCHeUhhO9aAwMO1GvPiJutHJdSztyQvzYYos8SMqxvLJ52RiIr4pwcnAcXB4/AZ BfdalUCtKqzihGvJMosAQOFCqMnnpA9F1bWE0gcJmdLeNvrHBLsw/GSm8zKZwLJLARvN 10D51u12Lf381oA/2kZKE2VDuNrfxbnyPv8zPArino1kBAcrOjk8wR+njxsu4Mz6mEhy yIR1RPLAFJYro7+twZACDlcKtIVFQv1JuAtKFU3qN9REK2id7ePZHWdW4bph/wbl1pSL oCog== 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 x14-20020a170902ec8e00b001b8a8f359fcsi601270plg.208.2023.07.20.02.31.16; Thu, 20 Jul 2023 02:31:29 -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 S229846AbjGTJ2e (ORCPT + 99 others); Thu, 20 Jul 2023 05:28:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230416AbjGTJ1u (ORCPT ); Thu, 20 Jul 2023 05:27:50 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58FE22727 for ; Thu, 20 Jul 2023 02:13:41 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id C2F9960012; Thu, 20 Jul 2023 09:13:36 +0000 (UTC) Message-ID: <90c8509f-bd0a-4996-adca-86f6116b5129@ghiti.fr> Date: Thu, 20 Jul 2023 11:13:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v4 00/10] riscv: Allow userspace to directly access perf counters Content-Language: en-US To: Atish Patra , =?UTF-8?Q?R=c3=a9mi_Denis-Courmont?= Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Aurelien Jarno , Mathieu Malaterre , Jan Newger References: <20230703124647.215952-1-alexghiti@rivosinc.com> <8756384.Zvl9fuB8X0@basile.remlab.net> <5951331.lOV4Wx5bFT@basile.remlab.net> From: Alexandre Ghiti In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-Sasl: alex@ghiti.fr X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Atish, Rémi, On 19/07/2023 19:14, Atish Patra wrote: > On Wed, Jul 19, 2023 at 7:46 AM Rémi Denis-Courmont wrote: >> 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. >> > Good to know. Thanks for the clarification. > >> 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. >> > Completely agreed. We will update the commit text with more clarification in v5. Thanks for all your comments and sorry for being slow here. I will improve the commit logs in the next version, that's an oversight, sorry about that. Thanks again, Alex > >>> 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/ >> >> >> >