Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2553889rwi; Fri, 28 Oct 2022 08:22:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM67QvZl6CrNZxBlWA314QLEmxL8e/yNXY5ONq7+fkJy5bqzP0LIaBteqv39qOoCSB8v9clr X-Received: by 2002:a17:907:2c4a:b0:78d:ee99:a06b with SMTP id hf10-20020a1709072c4a00b0078dee99a06bmr45673323ejc.578.1666970562809; Fri, 28 Oct 2022 08:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666970562; cv=none; d=google.com; s=arc-20160816; b=P2MWqH98N0Z2MY7G4e/5ua/IQN3b6REEgmF2jdo9MNClWP/CNJ5iX4EYOaGoJbXxS/ Nkm0pltvYS8wCXPaoeocafxIamVpmFY9ownvsc+lVJq/Jn7hKrC10AU91uQHevC5WJqI LoHVvdHusuG1I7muDv0r8X1LtXpBk4j54bKCNCUQPfdXXy5eDA9A1CLGVpd6DHGaY/iY zfJevOzcKcc5DKQt3YAec1t64JJXMchQhTVNC78GVr32mLhclOHXVjlRcbY5Iu6FJvxZ VSSx4U59rpUBIk4fxYCdmatksQxspMTF4nb26Hbs5qKBuHyOxxSGL8C+kYfxsp/RgppM m4pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=L2Wb1zu+ex1+MAe1bacuvWvll3Un4hvc3AI/k9h8CP4=; b=WW7bh1eLp0fm+I+m1epllkZ5iPIj7GOHrrQJ5gy369el8HeKpphToosGcJ61yQH1t4 oyTHN89lSNjgd2hdwLdNDauKKaAnaxYwoyRnz36pAVwjiA53FfIXDunISak7QZ/YQA2J nnWxSqRYSu2WETNi7JldDK1DUW3R1jyYwqk1Ar7PAkXhKxDSj6/np69d3X56mkA2kkD3 CO226H2ZkWe0pgqwHEtqzzOUOtGEO3b0WkMJlYkpAZJhKWN1MbKfkBfRg2L8Q8Julhpe xF2TEsKx8tNWj4O+lbeXFzJIvZwd/IeBHDTaJNWjHzp+IRacHb4AzJYPh/jY5M/U9NYF VSmA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p20-20020a170906a01400b0078df19995e4si3880619ejy.241.2022.10.28.08.22.15; Fri, 28 Oct 2022 08:22:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231154AbiJ1PBa (ORCPT + 99 others); Fri, 28 Oct 2022 11:01:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230150AbiJ1PBW (ORCPT ); Fri, 28 Oct 2022 11:01:22 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4A0A5CE98E; Fri, 28 Oct 2022 08:01:21 -0700 (PDT) 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 54C691FB; Fri, 28 Oct 2022 08:01:27 -0700 (PDT) Received: from e126311.manchester.arm.com (unknown [10.57.68.155]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 59DA53F534; Fri, 28 Oct 2022 08:01:18 -0700 (PDT) Date: Fri, 28 Oct 2022 16:00:43 +0100 From: Kajetan Puchalski To: "Rafael J. Wysocki" Cc: daniel.lezcano@linaro.org, lukasz.luba@arm.com, Dietmar.Eggemann@arm.com, dsmythies@telus.net, yu.chen.surf@gmail.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v2 0/1] cpuidle: teo: Introduce optional util-awareness Message-ID: References: <20221003144914.160547-1-kajetan.puchalski@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 On Fri, Oct 28, 2022 at 03:12:43PM +0200, Rafael J. Wysocki wrote: > > The result being that this util-aware TEO variant while using much less > > C1 and decreasing the percentage of too deep sleeps from ~24% to ~3% in > > PCMark Web Browsing also uses almost 2% less power. Clearly the power is > > being wasted on not hitting C1 residency over and over. > > Hmm. The PCMark Web Browsing table in your cover letter doesn't indicate that. > > The "gmean power usage" there for "teo + util-aware" is 205, whereas > for "teo" alone it is 187.8. This is still arguably balanced by the > latency difference (~100 us vs ~185 us, respectively), but this looks > like trading energy for performance. In this case yes, I meant 2% less compared to menu but you're right of course. [...] > Definitely it should not be changed if the previous state is a polling > one which can be checked right away. That would take care of the > "Intel case" automatically. Makes sense, I already used the polling flag to implement this in this other governor I mentioned. > > > Should make it much less intense for Intel systems. > > So I think that this adjustment only makes sense if the current > candidate state is state 1 and state 0 is not polling. In the other > cases the cost of missing an opportunity to save energy would be too > high for the observed performance gain. Interesting, but only applying it to C1 and only when C0 isn't polling would make it effectively not do anything on Intel systems, right? From what I've seen on Doug's plots even C1 is hardly ever used on his platform, most sleeps end up in the deepest possible state. Checking for the polling flag is a good idea regardless so I can send a v3 with that. If you'd like me to also restrict the entire mechanism to only working on C1 as you suggested then I'm okay with including that in the v3 as well. What do you think? Thanks a lot for all your time & input, Kajetan