Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp924187rdg; Wed, 11 Oct 2023 09:07:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEjp+YdyymAC9Cuwulbmpr8ahUcI7n0WKYE64eOWpLqJ1p1oGQp1wErTiTsmz6K294kGWmt X-Received: by 2002:a05:6e02:1d8c:b0:357:47a3:adbd with SMTP id h12-20020a056e021d8c00b0035747a3adbdmr4019063ila.30.1697040476335; Wed, 11 Oct 2023 09:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697040476; cv=none; d=google.com; s=arc-20160816; b=GuKsIXlnCaMEqHfUMFHMfokw0On5rkL9r49sdZTgYnxkMRuRUOoCNAkCz3FQEyT9Gd vc1xB2n0RAH45uIPmvTgtHcuVJDDPvZ+NKXJspJErIg+0mFIAHnr4xpfHx3OHu8jyTg/ JVcRwXibY2+OPYVSxIkT+eLNriKDyTGcJtKoyV31OukcJWgdcL0Qgajrij2zmP3y4tRo dQK95FcB5cutV0T9D4j+D2212pxa16dFjSqroIg3ClUL/eidp+ElFGmKBtME2kNkJkpk XwD+gxbQBUbRaCpNsVqrY6nGda5ugST0PL3FBUHElT3lFBGlCQf/Z0ZMgak5AGhV3n9T JQCw== 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; bh=SJbjl5tP1UgIM5sU7OhYg3bcCU8WFRD/3Un3uvzLovc=; fh=2Rc3UHPZ4xgSlzOz9B+w7Beaot7xIZMIXSx1YL7FULY=; b=BDt8AbQRU1Gh6+Vy3ofMA0m/sSiNVCWHjul9FmRXmNQGMwdnFghLpnq2Y8e69TQEwX FcauJF4RZZucv7zvE4wMPIQwvVomS1UjOFvDo4n6ATezNYGgfL4iyrPCaEP5FE1k7yAP 7xoYn4FUTFrTzOFpCfDRU1E4Zea/++LA0vlqnJy4EXWAosa7AXcOjILFsUeqGZNg2Sdm BmwuXey26dxbhrm5W5GEcILqanpjOckjTupI9AbSmSU8iTUKbhgwr1zO16/4N1xLLpEj x3M5gsqbi3VertYYt64kHECaDuEVoOU3b6x0a5JEvcwtG/eepoPTJazPHfE5XCFcwn40 fJlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id dc4-20020a056a0035c400b00690cff4a2b6si11989081pfb.112.2023.10.11.09.07.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 09:07:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 651398109D84; Wed, 11 Oct 2023 09:07:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232880AbjJKQHi convert rfc822-to-8bit (ORCPT + 99 others); Wed, 11 Oct 2023 12:07:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232345AbjJKQHg (ORCPT ); Wed, 11 Oct 2023 12:07:36 -0400 Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56E3C9D; Wed, 11 Oct 2023 09:07:33 -0700 (PDT) Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-57c0775d4fcso942eaf.0; Wed, 11 Oct 2023 09:07:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697040452; x=1697645252; 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=dpx2iMJcMAx/Jfpz+noMvSlj0roFwY4oLZzvU5pnyxM=; b=HX+K8Hjok0VBM/Z1hgwXzh7o73Wl4dBbIt40Az3EzIslezkqn/Hb+96HPAYzTGQrir 343uCZ7aCJnZD4MFK8y/Ii8dL+tH4m5XZzttrVdj5R0jEEtUwvmaSUx1FXwWz2hSQeB/ Ih8U+970gKouYA9CX4N5anvbq/NoduMefnLy/EKxxO7ROZPNiqkB5KU0ogzYx1+8hmUj VcDbC588761pfNUNQyaiM7hWE7tXDOxgYAlrvEwTrGLJ853U2yju1r11QBB9CkSqp97P IyinqKNYZN7zx61vLv8kVUth3bF8j4R11/CnXUOKhv9awHn4BJUNjKgNZP4fMl/pST9R Vw2A== X-Gm-Message-State: AOJu0YxDgreQB2NT7YNxJ4aRzypCUQAEgOPkvjTi5iOQGA7vpHL4bQ4j K/kA6ykjOlXM/XP1IGAPCTkCiMuZskH4Muyj+Pi+Hxnk X-Received: by 2002:a4a:de08:0:b0:56e:94ed:c098 with SMTP id y8-20020a4ade08000000b0056e94edc098mr20226212oot.0.1697040452515; Wed, 11 Oct 2023 09:07:32 -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: From: "Rafael J. Wysocki" Date: Wed, 11 Oct 2023 18:07:21 +0200 Message-ID: Subject: Re: [PATCH v4 10/18] PM: EM: Add RCU mechanism which safely cleans the old data To: Wei Wang Cc: Lukasz Luba , "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: 8BIT X-Spam-Status: No, score=2.6 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Wed, 11 Oct 2023 09:07:49 -0700 (PDT) X-Spam-Level: ** On Wed, Oct 11, 2023 at 6:03 PM Wei Wang wrote: > > On Fri, Oct 6, 2023 at 1:45 AM Lukasz Luba wrote: > > > > 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 AM 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. I agree, thanks! > > [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