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 X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7753DC49EA6 for ; Thu, 24 Jun 2021 11:15:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 63629613C1 for ; Thu, 24 Jun 2021 11:15:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232460AbhFXLRq (ORCPT ); Thu, 24 Jun 2021 07:17:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232444AbhFXLRh (ORCPT ); Thu, 24 Jun 2021 07:17:37 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75AB9C06175F for ; Thu, 24 Jun 2021 04:15:17 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id h15so9534430lfv.12 for ; Thu, 24 Jun 2021 04:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YBeXYZWV/5BphYQoBRycv7o/G0vcpUulJaPvVaWo0hY=; b=be5nxis7yjUUmikvo97sgsl1dVxYeKMBAmDqgtjaJ5IA+03sIPCdzB69LSB1K9XvoV IjmOl7yNCitywGNdQs6bQAd6fFOIxz9/MNhu1lIizTZymn6KU+FtSjqohDGGMdolqEHm fCj7x9ElobekxfYyfhyo2ukicjHUUEJ6h28TkNJPhSI8Wg3kDsNu8/F64T3EVJmN1y2I DK/yyEmbsdsZOcMc0irTDWynYHF8+RSVul+o1NZ9/JsAONc3y7ZYfxaAPHPalk0tl/bQ g+0afZEGN8BAsP5J8Vi4hXK+hbV59p9+KWW3dcDSncMkCTK7gSx8jXou3A2OQZGZXYis iXkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YBeXYZWV/5BphYQoBRycv7o/G0vcpUulJaPvVaWo0hY=; b=lDPDZhh3ymrO+P6IpnmKBN2WI7gJm/ZmLvEDgZQNdrrP4M+8Gz4aUZG5CcgwdGu4tv iH5a0AtN6GmqIG5KKvMX4wl+LMfOSsnEOvY/221qekpmA+T5eVZ45eJvMGJAXBAv45RV mm0wvfyzt3ntCtc/O5IlE8AKrOlf6JEzldEVubIpH0FOtbDubskmhxeBnN6Kj+P9d7ky LUFhlyKf21ARifFIqLcCwA6XcDccVqhwoHqxJ6gl3kjZhFyWDcrPfrOwQt0lovsFibNi Iq30fJ1t3lpT7r/dHfr4BLRkTse2PbWsPrS+bsmZ+DKNC3GyNYNC/fvVpH+JDk3nvkn3 OrLw== X-Gm-Message-State: AOAM5320pq+OGc4lR07+51jwbhzbEtx2KIgcIKPBtsUSOoZ4s5aj0Bli bV8TorL/8cKj/STVKDd60GBidQKUrEZithyYiRL75g== X-Google-Smtp-Source: ABdhPJxXzLBF4txHG71/WJOdpAJctSJcR8nWW7QGoWwlBzbZW8b2rBbyLZw9YycJrAVOGBQ6eF8Y8XHAqlIBzmqCZQY= X-Received: by 2002:ac2:4acf:: with SMTP id m15mr3604469lfp.286.1624533315667; Thu, 24 Jun 2021 04:15:15 -0700 (PDT) MIME-Version: 1.0 References: <09a39f5c-b47b-a931-bf23-dc43229fb2dd@quicinc.com> <20210623041613.v2lo3nidpgw37abl@vireshk-i7> <2c540a58-4fef-5a3d-85b4-8862721b6c4f@quicinc.com> <20210624025414.4iszkovggk6lg6hj@vireshk-i7> <20210624104734.GA11487@arm.com> In-Reply-To: <20210624104734.GA11487@arm.com> From: Vincent Guittot Date: Thu, 24 Jun 2021 13:15:04 +0200 Message-ID: Subject: Re: [PATCH V3 0/4] cpufreq: cppc: Add support for frequency invariance To: Ionela Voinescu Cc: Viresh Kumar , Qian Cai , Rafael Wysocki , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Greg Kroah-Hartman , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , "Rafael J. Wysocki" , Steven Rostedt , Sudeep Holla , Will Deacon , "open list:THERMAL" , ACPI Devel Maling List , linux-kernel , "Paul E. McKenney" , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Thu, 24 Jun 2021 at 12:48, Ionela Voinescu wrote: > > Hi guys, > > On Thursday 24 Jun 2021 at 11:49:53 (+0200), Vincent Guittot wrote: > > On Thu, 24 Jun 2021 at 04:54, Viresh Kumar wrote: > > > > > > On 23-06-21, 08:57, Qian Cai wrote: > > > > Viresh, I am afraid I don't feel comfortable yet. I have a few new tests in > > > > development, and will provide an update once ready. > > > > > > Oh sure, np. > > > > > > > Also, I noticed the delivered perf is even smaller than lowest_perf (100). > > > > > > > # cat /sys/devices/system/cpu/cpu8/acpi_cppc/feedback_ctrs > > > > ref:103377547901 del:54540736873 > > > > # cat /sys/devices/system/cpu/cpu8/acpi_cppc/feedback_ctrs > > > > ref:103379170101 del:54541599117 > > > > > > > > 100 * (54541599117 - 54540736873) / (103379170101 - 103377547901) = 53 > > > > I'm not sure that I understand your point. The formula above says that > > cpu8 run @ 53% of nominal performance > > > > I think this is based on a previous example Qian had where: > > /sys/devices/system/cpu/cpu0/acpi_cppc/highest_perf > 300 > /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_freq > 1000 > /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_perf > 100 > /sys/devices/system/cpu/cpu0/acpi_cppc/reference_perf > 100 > > ..so the 100 is not from obtaining percentage, is the reference > performance. > > The logic of the formula is to obtain the delivered performance when > knowing the number of ticks for each counter, so: > > So if one gets (103379170101 - 103377547901) ticks for the counter at > running at 1GHz(perf 100), what is the frequency of the core, if its > counter ticked (54541599117 - 54540736873) times in the same interval > of time? > > The answer is 530MHz(perf 53), which is lower than the lowest frequency > at 1GHz(perf 100). But the nominal_perf is 280 and not 100 if i'm not wrong so the perf value is 148 > lowest_perf in this case > > > > > > > > > > My understanding is that the delivered perf should fail into the range between > > > > lowest_perf and highest_perf. Is that assumption correct? This happens on > > > > 5.4-based kernel, so I am in process running your series on that system to see > > > > if there is any differences. In any case, if it is a bug it is pre-existing, > > > > but I'd like to understand a bit better in that front first. > > > > > > Vincent: > > > > > > Can that happen because of CPU idle ? > > > > > Not if the counters are implemented properly. The kernel considers that > both reference and delivered performance counters should stop or reset > during idle. The kernel would not account for idle itself. > > If the reference performance counter does not stop during idle, while > the core performance counter (delivered) does stop, the behavior above > should be seen very often. > > Qian, do you see these small delivered performance values often or > seldom? > > Thanks, > Ionela. > > > > -- > > > viresh