Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp146595pxv; Thu, 24 Jun 2021 05:01:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXhWNkRWHSM7Q1aeMCZAr80E+8l6SnLd0wJLzycXaQbkRmgQlKjLRaZzqfaDPQn1x3QZ9+ X-Received: by 2002:aa7:c857:: with SMTP id g23mr6484053edt.100.1624536065808; Thu, 24 Jun 2021 05:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624536065; cv=none; d=google.com; s=arc-20160816; b=F2SsGw4tS9krOkmWMUDmEksoCpFJbDv4CHpv4yx0SfqrWivFEA/6eHdIVFv03zPTSy hVZJM/hJjuZgIpHqoFThkdI2qxZfFPqGo65CD1ll99L3emtgr86wq/iug3Fn1fs+SMPK WZm7IqRgk1J1TI1uIXNKsF6OdlYOjExaqXNeI3rvVlH68GgWqyIZiTwrgB2SBGn01GYH chCZoNjT9JhEilVk8jSwL5wi5VLxc/vlFK0wVOGAjam7GfQw7fvxjgi+t5X0hqE8xdgy cz0ZZM82y2h/NTcUkoK1D2Z4oMhGLlpF/9imVUsDhCKwKbjPoTilRT0WBwxprXv5F/kS uZxg== 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=Xqb0SfAot0T+bnLINqL6hkkrh27//4C+mrBYM/KExsw=; b=TPAKX+1GaYxddOh5I9Vr62cmfcoqvWZTDQbwoaoCjA34pCYaH0arvIc7OqnjxxOCcx 3p8SyhrAH9dP3zyDVaDTTNkyXha8IS8lG3VmrQf86B2K8JI1Sr8caMo56qOAVQQsR/CQ 2X4UB7ACLieN+sNTHmJJ47Bd+OpYDeq/pt985DDI/f/5qW3IGHqX9fQ0JjdRiGZ3y1VO 9z/980/MmiUmDbNUHOWLW4wMsBcSPdUq3SpqEic5sK2UYNDR9sEb1YL9Fa3FQX6N79l8 hndUFO2sjqc0VmXS0IXQ6v7rhg/Sfdqbe4GE5aBjEFHN8R5kngwu1cE0jCyR/HcnvufJ Cnew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Htc1HoEB; 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 k16si2831902edv.498.2021.06.24.05.00.38; Thu, 24 Jun 2021 05:01:05 -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=Htc1HoEB; 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 S229878AbhFXMBy (ORCPT + 99 others); Thu, 24 Jun 2021 08:01:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229853AbhFXMBw (ORCPT ); Thu, 24 Jun 2021 08:01:52 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D00A9C06175F for ; Thu, 24 Jun 2021 04:59:32 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id i13so9826160lfc.7 for ; Thu, 24 Jun 2021 04:59:32 -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=Xqb0SfAot0T+bnLINqL6hkkrh27//4C+mrBYM/KExsw=; b=Htc1HoEBVFI1XgWupgitxfKw2XCjbvFJLPtUXneiCFiC55vuz7F4xJVJJGeJAoElBv tQuMdzME3RzbdQdWJklBAeHsx615hk+q7O3alOu+0dqeRbiG3UOJFx1rD1RyZGVa5HKX XnuRoAcubnoRC3yUKp0ksMR/cNkLFcag7qHeWM3OnyfdEMME7Uw59ftxNU70Y02gr0SL 1gxaOiWOjzBLwIg+G93gLfvsmovvo2PnbYH5qVbt59c6s+8ac2Cc8Eyi8zzFXq2Ann1I i50oU5+uodLhB3bSoeI86H40CGuhfLK19fZZfG2ezCTtw6cvbzpjN9WDiFT3Ch3oaz8u 9Qiw== 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=Xqb0SfAot0T+bnLINqL6hkkrh27//4C+mrBYM/KExsw=; b=m7AuJM1ggQ55aKUfDwhOfb02nFhzDOM5J+0XFqEu3Pl7ayF73Nl7OS6C3zbhGF8xEa bfVRKM5ghwUqckSf4sW6Go5r7zVAcAtA2GAwfi71XLmq78I9iNhuGUtc8WMpRX7RGuOr P3qrA2nZZi9cl75QuJyssAnQIiJHkMYojKDoCvxr48GfdrKJe8UKEb/svo0QIj6C4a+Z IVcYFDDlLdgDkvIzDOziqBDekzZ4wHCzoVx+1UVQpe4h3nIyJrO02/zPqs4DAJBgMuue UvtUDMStBQJ3EBBsmVtnf2BL3a5v+idcJtND1a7csUDw2zuhSlbTUAY7y0ZpXhckq21O 6sEg== X-Gm-Message-State: AOAM5326je5Lj17usUnqJEpTvU/+no6g/AMbXVjPs7jUCG10iNE5FmQ2 5UJ2sv901d2Wv5q9BsR+iFqxskEAepAscZRa936IQw== X-Received: by 2002:ac2:4949:: with SMTP id o9mr3675161lfi.254.1624535971136; Thu, 24 Jun 2021 04:59:31 -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> <20210624112331.GA22416@arm.com> In-Reply-To: <20210624112331.GA22416@arm.com> From: Vincent Guittot Date: Thu, 24 Jun 2021 13:59:20 +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 13:23, Ionela Voinescu wrote: > > On Thursday 24 Jun 2021 at 13:15:04 (+0200), Vincent Guittot wrote: > > 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 > > > > Nominal performance has no meaning here. The reference counter ticks > with the frequency equivalent to reference performance. > > Nominal performance is the maximum performance when !boost. Highest > performance is the maximum performance available including boost > frequencies. So nominal performance has no impact in these translations > from counter values to delivered performance. my bad, nominal_perf == reference_perf on the systems that I have locally > > Hope it helps, > Ionela. > > > > > > > > > > > > > > > > > > > > > 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