Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2555895rwi; Fri, 28 Oct 2022 08:24:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NSTImE74AcV0nd3c4jEZFprK02lWT/fkCU6K99ZmGagm8FWWVgsLr4utjjShyGiXFw9ph X-Received: by 2002:a17:907:70b:b0:740:ef93:2ffb with SMTP id xb11-20020a170907070b00b00740ef932ffbmr46549849ejb.93.1666970632252; Fri, 28 Oct 2022 08:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666970632; cv=none; d=google.com; s=arc-20160816; b=YhLMMFBjq3MPdAJL6tnEwEHShfjXVITU+pLKzhaXO56pOrB67qF0scO4Jv4YlX700/ MD+DySBaVE1YlHaZXrQ4RFXxQmhknUz0WxPY4mgbfK2Bf9gyZSsawIr2PSZhH+Vzuc1W pdm5oTh+DZ2xn/AiijBhyiyFjCGFJHggibmZ/2nI3uVZ4x7itIzMPGOSGEzrP6MVId5D eCURhswgYXKBeWoPijSRPgSLx000Xj2HJRDMc9W9GeM7/oxAZ6KmulN8XwugOXSVdbnC p+WsRBFnSOC3Ha3I2MRV+dDY/SOTmzjzt7CatOPicAaNG8TewG6AnuBPPnsQCazV+/qY FEMg== 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; bh=qdhDbctiiApnLTLWGH9oZuXOT2uma5fefrG214/GCHQ=; b=AvPPlqyRRqC6dTRJxAwnwVkvuL2kO4FiYU/j0S8xLRSoh1cB8tamJGjxp+DR9S9wEh xJeEMDoEXzh6K6WFsC3YsoGXng/j7b9iC/FdvCmzJbhCR1R/NqET3NlMHALbp9sm5Qnz 221Tq8N2J+x+l9Q7kxlgNKuBuV/wntdWdP6qadJWlMT79RdE7rOe5vuy5Aba1sIzFuf2 OH/GeKvJYlB+XJsgvFogSTHs8IBu/3z4Libqpqy6qLubljX1RIVXcyOibbt895uryevK MaVCD5WbqpS8Bwg96qKNKtKOo9LmzpHsMWizBnFsCXdOuFRBPrFBtOW4tWcg/ej5KmhJ EiEw== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020a05640211cf00b0045d5e3c7f44si5686978edw.180.2022.10.28.08.23.27; Fri, 28 Oct 2022 08:23:52 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229776AbiJ1PFG (ORCPT + 99 others); Fri, 28 Oct 2022 11:05:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbiJ1PFD (ORCPT ); Fri, 28 Oct 2022 11:05:03 -0400 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D40592528F; Fri, 28 Oct 2022 08:05:00 -0700 (PDT) Received: by mail-qk1-f179.google.com with SMTP id d13so3586469qko.5; Fri, 28 Oct 2022 08:05:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qdhDbctiiApnLTLWGH9oZuXOT2uma5fefrG214/GCHQ=; b=RD0Nf+7mtjbCdAD9KfJHF6CDvdZB9t0jiRvPUiKPohvTXELkekNKl5PyGKUtg1fJSL RewWZWu/RsZwXIVYnx+XsvIexC7WpwdQbe41sgBC4B2G8Y9WkzgNThwwtFQs/xpsymxu rH/18bNEkqOTtUC/xeXmyt/Lzf2VW4eVwAR4Is84kA85OCJPJA3P1F1d/bdC63Q2Jm0V Np6c9PlRD8OppKrqmg6Nkv67prJegttVIomsmX0g3AzBdGz6+HHxzg2E3dlWQmL4mIxS EfjXtzVIhzQbkJEEt0MAanZT3NOxiJ2cs+Id3Eg86JYTuHktRiw3eA3yv0ZsSVBmMhm6 +4MQ== X-Gm-Message-State: ACrzQf3B+mVy7XxwuDQjTn7kppnx7u3JvohxK7Wxs6yUXexNeGt8ORFk x4sH4YkhjZ3xL8SpOXOvDIQqFbtbUmpOwDqQQb0= X-Received: by 2002:a05:620a:4547:b0:6ee:dc16:d67a with SMTP id u7-20020a05620a454700b006eedc16d67amr39255160qkp.23.1666969499908; Fri, 28 Oct 2022 08:04:59 -0700 (PDT) MIME-Version: 1.0 References: <20221003144914.160547-1-kajetan.puchalski@arm.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Fri, 28 Oct 2022 17:04:48 +0200 Message-ID: Subject: Re: [RFC PATCH v2 0/1] cpuidle: teo: Introduce optional util-awareness To: Kajetan Puchalski Cc: "Rafael J. Wysocki" , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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 5:01 PM Kajetan Puchalski wrote: > > 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? Indeed. > 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. That depends a lot on the workload. There are workloads in which C1 is mostly used and the deeper idle states aren't. > 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? It would be good to do that and see if there are any significant differences in the results. > Thanks a lot for all your time & input, No problem at all.