Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp118036pxv; Thu, 24 Jun 2021 04:16:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqUDfbwzg/40MsSX9gycS0ska6Et/VuI/Cdx5zueGBwNnzB5LanrwLIGhfF25qL1emekt7 X-Received: by 2002:a92:bd06:: with SMTP id c6mr3211900ile.110.1624533381953; Thu, 24 Jun 2021 04:16:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624533381; cv=none; d=google.com; s=arc-20160816; b=daKDk2d+UhYVXiEDLypZn/4BSFakn1g77gdKSCK9Q9Y1dl59gBqe0thkNH2YeOoEPl 4cBVb0sFZH0/ha42VJhrGCvQOXuIgNuwHXAzvhZpFx+NoBy3Qva6GvRHaOTgmC0W5olZ Y35jae0McOnabxMUdubDYuuxHfSGI6Fq/5sU5e0W178zP2XtQqeufq4JvQOBrWE9oyvB vs1SN0IK5FpqviIUOPM5uHN6FOWo5Mc+Q1AEQUiX4PsvrV+k7PJvmuLZxZVkYz1KpS/w nHBeeV2c07EaoIgumBGdNfYA2rszH89Z2VvsKjl4MDJIjseua55e3r9Y1vkGIqHeJ/ZL LvBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YBeXYZWV/5BphYQoBRycv7o/G0vcpUulJaPvVaWo0hY=; b=0vmGY77mnfEa5EbmOQjrlBrmjCWczynPqO+lX1jD1RsQWrzc5UOqsW09BqsZ/94lyu IEyXBP7jiExu2/eFkxa/Hn8u5FiPn+djKWvch8UpS8HKHdkpKRNfkBYU/8XlQhwfvxdS zpqzPyRLCUNt+HFAz7YMhm8mAe3wGECTZaPXihPlGs//S4ryHuflJjBjWsbztvBCfw4M KlSX3aDs/uv3eE2jm3ueruaNU0o6xixC7aH4+Y+tVpYeatNfwbbsbZqGEUHU+4fn6UW0 5/dcXw1gwCEYN+eXRYvjxsT5UUE2LGKbt0Ntwq8eomiU8rmgNqP1AdPxIkjFG6WU2kNn xc/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=be5nxis7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n16si2174680iob.72.2021.06.24.04.16.04; Thu, 24 Jun 2021 04:16:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=be5nxis7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232464AbhFXLRq (ORCPT + 99 others); Thu, 24 Jun 2021 07:17:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232338AbhFXLRh (ORCPT ); Thu, 24 Jun 2021 07:17:37 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68FA7C061756 for ; Thu, 24 Jun 2021 04:15:17 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id d16so9615451lfn.3 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=duFksIA63KbCepJpC5lOKkvW+QCc12WGpRkEDczEvPfqP9LGc/9DnNfUKDkdEDOwg0 GFAZvKhQQORi4R1+UUsjq+VuBsmdAnRXGNM3iOqq/0OBY3uQu3ClMXh8M6FYsGSI0VXs YZF3fBV/Zy9WriNuZxLXQCfUDjw1tFYEl5Ums5yJGTiU/mxYy7govy91QThT344FowbZ LmBJowJOA9wBRUSwzt0PX6tgTGCDQZgpXnB4YoLo4kr1gwUkFVHXUI3eUrR+3lbosQ1c Xn+snzjj9BzH/ofJAk07RKhtwrGe3HlBxAx/ho9QaS5UlSz6qbnYzvgw6uHIDcyvnomB PQAw== X-Gm-Message-State: AOAM530DrOpX79xbW1LP1zBcKNNwE3aNkTslEjlLggHCkakzk6qPolbX SJUqwvbBNwI3l+jgnNgdbNlKz2+A7xYqZIRVWqKFOg== 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-kernel@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