Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp919973rdg; Wed, 11 Oct 2023 09:03:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPn54bhxAB9Nk1ZMznDeN4ef5cVnJnhtTUqsEtjm3As1TcrAOrh2saXlyopc64WMUfx2tR X-Received: by 2002:a05:6a00:1892:b0:68e:496a:7852 with SMTP id x18-20020a056a00189200b0068e496a7852mr26411264pfh.27.1697040196250; Wed, 11 Oct 2023 09:03:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697040196; cv=none; d=google.com; s=arc-20160816; b=h46U3VIfjoDTzvmQdaCgI3M8e9Vm3PYbdQCkN1zl55A0PN9Xh8fktX4F8EkAZJfQeK q1QD6SrHicL8Z+8kaqEMdKHlNgb5x5Gl/oakTUG56BWyVR9ZcIdCaKxNSMiiRwOSp1u6 OFYi4Gzty4px2xbcL1YtuBsb2zMpWA5m1y1LrZabzyOmQyeprZ/t7KSYT6uwjVpdyHNt /5Eg82Wp6V4vGg0zwGcQVo8ntbl8QNt6sYs3I7G/8DrL2ZZ6ssNoRzKRY8k6eq1051YB do6pN5QwIw/DxHRQS/BpiJ1i17p+z+fh7v5j+l4tnZ7/Eya/pg59GfHv1VJCiZpMBfZy R1kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=OoKWKl4zkP3o8axsjYJ+ZddNhDutGWrPLWxeIBPAkTs=; fh=z5ojZ2e4jm88jkXMYbFtVaDNGSiNJQDZSgY5PLs0n3M=; b=QP1rUDpsENm3O7XLscrVBDD2jcElCYVZLY6xeiqN/JGCKQ9sz7fJQioA7/GB79CsIX bq0fDy2rv3ihdgGw9b0G7H1SvGoiIfZTnf2AXkKs1lyrnWcsROpYI9MW/2S8Az3Ipvno 3r+vFCcQ/3+oyHQ9+AsAyRoLIuWVTqt8dcusXdMdLNiQbkEH2zIo9E0nXQLY1jYJxLfF 4Mi/eIZq/7MbQlRcY/+Ys5rTVx8Q8gEGKuIA/cMefced45zocr36AJSXN5xePeZfgIBq QyeA4pqKp9O/OsfAU1ZJqO/yy6G0k5T04B0XfgkbblGPSdq8Dyzt9I6WA24N8N/Jyrrn Tqsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Lw1CziiA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id x6-20020a63fe46000000b0059f0cebd054si56803pgj.731.2023.10.11.09.02.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 09:03:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Lw1CziiA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 90A8F8253FF2; Wed, 11 Oct 2023 09:02:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232812AbjJKQCm (ORCPT + 99 others); Wed, 11 Oct 2023 12:02:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232345AbjJKQCl (ORCPT ); Wed, 11 Oct 2023 12:02:41 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41A9F8F for ; Wed, 11 Oct 2023 09:02:40 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9b2cee40de8so242489566b.1 for ; Wed, 11 Oct 2023 09:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697040159; x=1697644959; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OoKWKl4zkP3o8axsjYJ+ZddNhDutGWrPLWxeIBPAkTs=; b=Lw1CziiAzoNcdJJ09nwB4qdd0iviMQYsanHrW2xFx0NtEhh2d6m2zClLanFDLCcDHT l/OXpgMbESd8GGGwA91MtyoefB6BnJ4YqOtu/ElaA/NQhVganU+CeSsInKtsKkt0oSGW 38JzUxpp+GLkFSBKcD9e7Cpoq20RZN7C4MTMsELNa4ZyOjH2mY2NtyAl/EIMWF5kuxwM NGrBLGwtcF70FAqUQbQnLU/7oTEU7cVL2HVxrsYKCrGqGOwxXYiCXHDV77mSOqIi4tUK PzVllDbQn3u32eETea8/DnI4MpjkEbAY66QLVZBi1c2NIdmmdPhtyccK5MgKXFH7HR0e GCLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697040159; x=1697644959; h=content-transfer-encoding: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=OoKWKl4zkP3o8axsjYJ+ZddNhDutGWrPLWxeIBPAkTs=; b=L61RQlMHYTmbvoHmUiyme5EbZ1a9V5TjRbL9e1AyclCtxXOOXfXCSbi9hRQuys+eY7 EMUCtPlKLDSF5ECyFX5LZa5MY3vPJFQ+CvmbLIyl8q4+ZymW0xXZpPZJJoMyFCQ/BwKR owm0ROxsMTpQ2G5fJ4D7Uth7FjQbpqGG3ofvBKx/8KUFiWmHnQLYwdhW2ocjK2lYzycK GWaLB2RJGNBnon3egq3JKGKBydVK0Oayx+af79AjHL6fCVkboMhaeG00+Hm4iDdaso2c 9Q9C4nvqoc0RRbEXcibftYlgJK/qpV1FDzpUlvUEgdLczyT3yVJ0FLA6DDQ37P0hDLIZ uMlw== X-Gm-Message-State: AOJu0YyeK5ZXhp9v6FCP2gKOSAmoF8sSEMMuOy11tGxc8Dvc0s1s5rcm MsZxYUTNofUzcoY/6I4Ac/PPFOMQ1rvk3yQLX6UIVg== X-Received: by 2002:a17:906:8464:b0:9a1:f1b2:9f2e with SMTP id hx4-20020a170906846400b009a1f1b29f2emr16851557ejc.2.1697040158329; Wed, 11 Oct 2023 09:02:38 -0700 (PDT) MIME-Version: 1.0 References: <20230925081139.1305766-1-lukasz.luba@arm.com> <20230925081139.1305766-11-lukasz.luba@arm.com> <57078a6b-83bc-d558-1071-be23d213a56f@arm.com> <666857b9-729d-7af3-5d9a-9d9e4c0a68e2@arm.com> In-Reply-To: <666857b9-729d-7af3-5d9a-9d9e4c0a68e2@arm.com> From: Wei Wang Date: Wed, 11 Oct 2023 09:02:22 -0700 Message-ID: Subject: Re: [PATCH v4 10/18] PM: EM: Add RCU mechanism which safely cleans the old data To: Lukasz Luba Cc: "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dietmar.eggemann@arm.com, rui.zhang@intel.com, amit.kucheria@verdurent.com, amit.kachhap@gmail.com, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, len.brown@intel.com, pavel@ucw.cz, mhiramat@kernel.org, qyousef@layalina.io Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 11 Oct 2023 09:02:55 -0700 (PDT) On Fri, Oct 6, 2023 at 1:45=E2=80=AFAM Lukasz Luba wr= ote: > > Hi Rafael, > > A change of direction here, regarding your comment below. > > On 10/2/23 14:44, Lukasz Luba wrote: > > > > > > On 9/29/23 13:59, Rafael J. Wysocki wrote: > >> On Fri, Sep 29, 2023 at 11:36=E2=80=AFAM Lukasz Luba wrote: > > > > [snip] > > > > [snip] > > >>>> Apparently, some frameworks are only going to use the default table > >>>> while the runtime-updatable table will be used somewhere else at the > >>>> same time. > >>>> > >>>> I'm not really sure if this is a good idea. > >>> > >>> Runtime table is only for driving the task placement in the EAS. > >>> > >>> The thermal gov IPA won't make better decisions because it already > >>> has the mechanism to accumulate the error that it made. > >>> > >>> The same applies to DTPM, which works in a more 'configurable' way, > >>> rather that hard optimization mechanism (like EAS). > >> > >> My understanding of the above is that the other EM users don't really > >> care that much so they can get away with using the default table all > >> the time, but EAS needs more accuracy, so the table used by it needs > >> to be adjusted in certain situations. > > > > Yes > > > >> > >> Fair enough, I'm assuming that you've done some research around it. > >> Still, this is rather confusing. > > > > Yes, I have presented those ~2y ago in Android Gerrit world > > (got feedback from a few vendors) and in a few Linux conferences. > > > > For now we don't plan to have this feature for the thermal > > governor or something similar. > > > > I have discussed with one of our partners your comment about 2 tables. > They would like to have this runtime modified EM in other places > as well: DTPM and thermal governor. So you had good gut feeling. > > In the past in our IPA (thermal gov ~2016 and kernel v4.14) we > had two callbacks: > - get_static_power() [1] > - get_dynamic_power() [2] > > Later ~2017/2018 v4.16 the static power mechanism was removed > completely by this commit 84fe2cab48590e4373978e4e. > The way how it was design, implemented and used justified that > decision. We later used EM in the cpu cooling which also only > had dynamic power information. > > The PID mechanism in IPA tries to compensate that > missing information (about changed static power in time or a chip > binning) and adjusts the 'error'. How good and fast that is in all > situations - it's a different story (out of this scope). > So, IPA should not be worse with the runtime table. > > The static power was on the chips and probably will be still. > You might remember my slide 13 from OSPM2024 showing two power > usage plots for the same Big CPU and 1.4GHz fixed (50% of fmax): > - w/ GPU working in the background using 1-1.5W > - w/o GPU in the background > > The same workload run on Big, but power bigger is ~15% higher > after ~1min. > > The static power (leakage) is the issue that this patch tries > to address for EAS. Although, there is not only the leakage. > It's about the whole 'profile', which can be different than what > could be built during boot default information. > > So we would want to go for one single table in EM, which > is runtime modifiable. > > That is something that you might be more confident and we would > have less diversity (2 tables) in the kernel. > > Regards, > Lukasz > > Indeed, we had a conversation about this with Lukasz recently. The key idea is that there is no compelling reason to introduce diversity in the mathematics involved. If we have confidence in the superior accuracy of our model, it should be universally implemented. While the governors are designed with some error tolerance, they can benefit from enhanced accuracy in their operation. Thanks! -Wei > [1] > https://elixir.bootlin.com/linux/v4.14/source/drivers/thermal/cpu_cooling= .c#L336 > [2] > https://elixir.bootlin.com/linux/v4.14/source/drivers/thermal/cpu_cooling= .c#L383