Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5212100pxj; Wed, 26 May 2021 05:37:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9do5xPRZB7vUKIlzmpQTIn1kNcKUFcg99Uc+tu0kJCD2x2KMpu63pl/JAjy/t0KxdOUNt X-Received: by 2002:a17:906:1399:: with SMTP id f25mr33870886ejc.29.1622032656956; Wed, 26 May 2021 05:37:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622032656; cv=none; d=google.com; s=arc-20160816; b=wLQuYd5/8g/m2sDAfL46UviMeorIJ+q9MhQ7PsDa1Q+Ymj5IBamk1+Bd7vWkU33NgW tp6+ipX5bN/GiuaA28y3hzf/64A+7ZEweJbRBqQxaWuaiAp60RiXfmq9X9QfhDgDD6SB FVuKbBsDqg04B9dXZCXQsQFfX8lpUgkrBk1av5bPRkdiSjbeN3bbhlXBDRAy5KXbmb/5 ph0Bjf5/ad5dfUvNaErrhskzHjplguh4LTCSpnbFhyMOGNXDcPELQ61TTYT6uoyMeWF3 dRhkaJrdGFY3T3Nu63FQOIBfJgL2NY4UfcCEbn3/kFz38docvXqvsBmkKnLjG5DbBpzD tjsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ecwIlSn1pxVepS/sPxnDiMxdQbRYxeHfuHh77NkLwyc=; b=09Uo1sR1vFaTX2iYcHul4FhhYJkw3cqaGRkCSj9EbAPneQTM1r19lBt78eS4Ps/QXQ YVZeGOdl0VD8D8V8+TIwrMpHHuo5uVadgrMEe8pIQHw4lYBnypzJXBFbU0b2pnNeY2bj yHzsQevyZGT+/Dov+zeKKA/7DervBISrEEsehUz6Uj4SR5SMYPZ1/h57WxX7NfAWGCBu Ju2o1dRlcjjPe8LHNonh6zTAEKgD8WJqhYtk6PEFWmp8pgYzWAv9hPvjKvP4ejfu9/ls Zms+dufnXibdeGXZgafPl8jfmOayeTVApl9H0WBbGMeZ0S0vDgWHjp59bsy4ibsHqNj8 PrXA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u16si18792119ejj.227.2021.05.26.05.37.12; Wed, 26 May 2021 05:37:36 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233967AbhEZKZ6 (ORCPT + 99 others); Wed, 26 May 2021 06:25:58 -0400 Received: from foss.arm.com ([217.140.110.172]:42602 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233847AbhEZKZw (ORCPT ); Wed, 26 May 2021 06:25:52 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D63E21516; Wed, 26 May 2021 03:24:20 -0700 (PDT) Received: from [10.57.31.7] (unknown [10.57.31.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C1CF83F73B; Wed, 26 May 2021 03:24:18 -0700 (PDT) Subject: Re: [PATCH v2 0/3] EM / PM: Inefficient OPPs To: Viresh Kumar Cc: Vincent Donnefort , peterz@infradead.org, rjw@rjwysocki.net, vincent.guittot@linaro.org, qperret@google.com, linux-kernel@vger.kernel.org, ionela.voinescu@arm.com, dietmar.eggemann@arm.com References: <1621616064-340235-1-git-send-email-vincent.donnefort@arm.com> <20210526034751.5fl4kekq73gqy2wq@vireshk-i7> <20210526090141.GA408481@e120877-lin.cambridge.arm.com> <20210526093807.sih5y4lgltsz3r74@vireshk-i7> From: Lukasz Luba Message-ID: <17d88121-4809-dc31-1b57-2134ec868c8b@arm.com> Date: Wed, 26 May 2021 11:24:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20210526093807.sih5y4lgltsz3r74@vireshk-i7> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/26/21 10:38 AM, Viresh Kumar wrote: > On 26-05-21, 10:01, Vincent Donnefort wrote: >> I originally considered to add the inefficient knowledge into the CPUFreq table. > > I wasn't talking about the cpufreq table here in the beginning, but calling > dev_pm_opp_disable(), which will eventually reflect in cpufreq table as well. > >> But I then gave up the idea for two reasons: >> >> * The EM depends on having schedutil enabled. I don't think that any >> other governor would then manage to rely on the inefficient OPPs. (also I >> believe Peter had a plan to keep schedutil as the one and only governor) > > Right, that EM is only there for schedutil. > > I would encourage if this can be done even without the EM dependency, if > possible. It would be a good thing to do generally for any driver that wants to > do that. > >> * The CPUfreq driver doesn't have to rely on the CPUfreq table, if the >> knowledge about inefficient OPPs is into the latter, some drivers might not >> be able to rely on the feature (you might say 'their loss' though :)) >> >> For those reasons, I thought that adding inefficient support into the >> CPUfreq table would complexify a lot the patchset for no functional gain. > > What about disabling the OPP in the OPP core itself ? So every user will get the > same picture. There are SoCs which have OPPs every 100MHz even at high freq. They are used e.g. when thermal kicks in. We shouldn't disable them in generic frameworks like OPP. They might be used to provide enough CPU capacity, when temp is high. Imagine you have a board which does some work: sends and received some UDP packets. The board has been tested in oven that it will still be able to handle X messages/sec but using an OPP, which in our heuristic is 'inefficient'. You cannot go above, because it will overheat the SoC, you might go below and find first 'efficient' OPP. You might harm this board performance if e.g. the OPP is 20% slower that this 'inefficient' which was tested by engineers. > >>> >>> Since the whole thing depends on EM and OPPs, I think we can actually do this. >>> >>> When the cpufreq driver registers with the EM core, lets find all the >>> Inefficient OPPs and disable them once and for all. Of course, this must be done >>> on voluntarily basis, a flag from the drivers will do. With this, we won't be >>> required to update any thing at any of the governors end. >> >> We still need to keep the inefficient OPPs for thermal reason. > > How will that benefit us if that OPP is never going to run anyway ? We won't be This OPP still might be used, the Vincent heuristic is just a 'hint'. Schedutil will check policy->max and could clamp the 'efficient' returned freq to first allowed, which might be 'inefficient' > cooling down the CPU then, isn't it ? The 'inefficient' OPP is called from our 'energy placement' angle. For other folks from automotive, industrial or IoT who are stress testing SoCs and boards in various circumstances, they might call our 'inefficient' perf state as 'efficient' - for they need. In our internal review I pointed that we are optimizing for mobiles with this and we might actually need a #ifdef, config or a switch for this heuristic.