Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp256913lqh; Thu, 28 Mar 2024 00:31:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX+ITUawzeIL+nuSD/3zOGxX16D7gQQ8bNA0kG85/qr9qbF0zvk6gB/v8iYQRc9L/786Q7lzLetFeKmJc7D7d+CyXHDQsX1CZVI/+NT2w== X-Google-Smtp-Source: AGHT+IHAxMhSMZ7eVApI80gB5DNWepvyhQYpcn8YFWVOsjCTgKRk8uc5vfTOVWGrKlbdhEq4fhcN X-Received: by 2002:a05:6871:590:b0:220:94b4:2074 with SMTP id u16-20020a056871059000b0022094b42074mr2046928oan.37.1711611070468; Thu, 28 Mar 2024 00:31:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711611070; cv=pass; d=google.com; s=arc-20160816; b=TMdJ837KXDFDjl33KlA5ENZ3x+zg721sSEu00mLYN+uE0w1SXsEPjkMDqOy2ypl6f3 TN/UOde9bdYhPPrVnzc870tEadvYGCbWwUTpGEuEUGwM9y0w+1mJoSr89hIhYKOgOFgr 4s1XFxt7Z7BImDNh+v3rfI25Wn6l/1ifSGyLSwirVgfZZiJCec+0HfHeEhaCDqbbkX67 ySvg0kKiAdshEZ1oS/3CWJXYWTQWf3XieyNivhiZ57wiCmMGW+P9SXCOO0eexaU/FSiH FsVbwCYRe6Wohblg/RdCKuEb+2X/sCyIEEWI8quXJGAMPxtndv2Xuyc68idM0n/Clzk1 Megw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=8WQyzjuEuOb6PL4eEWIxiYWSZa115fZc5UHKQlBetXY=; fh=6s6ytHZ5fbt/0Rci8Av9znUGQKGUoC1ubYUNrsX7sjY=; b=iQpB0ce4wFbSpdrEOi2PW7JmB8QwP0SCd0/AbWzKVW6GIbVDV2Wdlcuhbq3IU4+2eB eUlFlCDkryzWHFwhEBXfweWG2pwviaH1bVGskcsd/rUrU/jBexYXSLqtdYnhjLzf0vFW MkyOFHiPTEiY3LTL9NxW91w8+654/BIyuXkbgwamldcYeDxYhgEDUjUQNuS4SGhilC7u hMmPKNRx3ULhiVwGnwl2fpOrizs97T8FzGWQGg1lf53Io2zOS/D8H/870VzF1Jci6gJS 57Tl8ypz/8dbyFSySQX1LShh6h2x33qvS16+VZomw5Nmhj50YMRJxGIfLqQ4PNiEPl+G 0F3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-122506-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122506-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k5-20020aa788c5000000b006e6b5eb6c01si978518pff.376.2024.03.28.00.31.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 00:31:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122506-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-122506-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122506-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 19190298B4E for ; Thu, 28 Mar 2024 07:31:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF081535DE; Thu, 28 Mar 2024 07:30:35 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 712202C6B8; Thu, 28 Mar 2024 07:30:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711611035; cv=none; b=TVDzjvxOSf5nCoa/W3OCF//T6pcmZclSTa+xSjNHn5A+Li8NqF5wPbhSUV+kw95P8VZj1R9mtgZORkHCCism9kvLD3T0MTcoayjwsq0ZTSxhHNwzr8QEGNEQfGLT3UvAM4zmMfxrptX5Pk1zPR38uGziGonCON8pX9YdEjfvjs4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711611035; c=relaxed/simple; bh=3exzUqajDFk/5+jRBK0S4zTkjn1GxyDjBzP18yJnkn0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aRgY1xop8AhtIAnyMgLSyKUYWVuvff3GuhzBE5ry/o4ChEyAbf2jEL2g1NIpMf4onKMw0vO2o0JcxfcXW3h8eIzruFM76FFULHcIt9fSw0lGXlIftpWrQS8wUxmF0qTzeeOF0+OhvhrDuvPgKOwwpTAT2QzB7tLjbXzMxdZzwms= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 9D1A02F4; Thu, 28 Mar 2024 00:31:06 -0700 (PDT) Received: from [10.57.73.83] (unknown [10.57.73.83]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7B2123F64C; Thu, 28 Mar 2024 00:30:30 -0700 (PDT) Message-ID: Date: Thu, 28 Mar 2024 07:30:29 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RESEND][PATCH v2 3/4] PM: EM: Add em_dev_update_chip_binning() To: Dietmar Eggemann Cc: linux-arm-kernel@lists.infradead.org, sboyd@kernel.org, nm@ti.com, linux-samsung-soc@vger.kernel.org, daniel.lezcano@linaro.org, rafael@kernel.org, viresh.kumar@linaro.org, krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, m.szyprowski@samsung.com, mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org References: <20240322110850.77086-1-lukasz.luba@arm.com> <20240322110850.77086-4-lukasz.luba@arm.com> <30ee98e9-3d9a-4be8-8127-043f68a7dcb1@arm.com> <410c5da7-c79c-4607-9aa3-2e78d991d2d7@arm.com> <9f2f5c94-cc9f-4a16-9b70-f00598af8cab@arm.com> Content-Language: en-US From: Lukasz Luba In-Reply-To: <9f2f5c94-cc9f-4a16-9b70-f00598af8cab@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 3/28/24 07:21, Dietmar Eggemann wrote: > On 27/03/2024 13:55, Dietmar Eggemann wrote: >> On 26/03/2024 21:32, Lukasz Luba wrote: >>> >>> >>> On 3/26/24 10:09, Dietmar Eggemann wrote: >>>> On 22/03/2024 12:08, Lukasz Luba wrote: >> >> [...] >> >>>>> +    return em_recalc_and_update(dev, pd, em_table); >>>>> +} >>>>> +EXPORT_SYMBOL_GPL(em_dev_update_chip_binning); >>>> >>>> In the previous version of 'chip-binning' you were using the new EM >>>> interface em_dev_compute_costs() (1) which is now replaced by >>>> em_recalc_and_update() -> em_compute_costs(). >>>> >>>> https://lkml.kernel.org/r/20231220110339.1065505-2-lukasz.luba@arm.com >>>> >>>> Which leaves (1) still unused. >>>> >>>> That was why my concern back then that we shouldn't introduce EM >>>> interfaces without a user: >>>> >>>> https://lkml.kernel.org/r/8fc499cf-fca1-4465-bff7-a93dfd36f3c8@arm.com >>>> >>>> What happens now with em_dev_compute_costs()? >>>> >>> >>> For now it's not used, but modules which will create new EMs >>> with custom power values will use it. When such a module have >>> e.g. 5 EMs for one PD and only switches on one of them, then >>> this em_dev_compute_costs() will be used at setup for those >>> 5 EMs. Later it won't be used. >>> I don't wanted to combine the registration of new EM with >>> the compute cost, because that will create overhead in the >>> switching to new EM code path. Now we have only ~3us, which >>> was the main goal. >>> >>> When our scmi-cpufreq get the support for EM update this >>> compute cost will be used there. >> >> OK, I see. I checked the reloadable EM test module and >> em_dev_compute_costs() is used there like you described it. > > I had a second look and IMHO the layout is like this: > > Internal (1) and external (2,3) 'reloadable EM' use cases: > (EM alloc and free not depicted) > > 1. Late CPUs booting (CPU capacity adjustment) > > e3f1164fc9ee PM: EM: Support late CPUs booting and capacity adjustment > > schedule_delayed_work(&em_update_work, ...) > > em_update_workfn() > em_check_capacity_update() > em_adjust_new_capacity() > em_recalc_and_update() <-- (i) > em_compute_costs() <-- (ii) > em_dev_update_perf_domain() <-- external > > 2. Reload EM from driver > > 22ea02848c07 PM: EM: Add em_dev_compute_costs() > 977230d5d503 PM: EM: Introduce em_dev_update_perf_domain() for EM > updates > > em_dev_compute_costs() <-- external > em_compute_costs() <-- (ii) > em_dev_update_perf_domain() <-- external > > 3. Chip binning > > this patchset PM: EM: Add em_dev_update_chip_binning() > > em_dev_update_chip_binning() <-- external > em_recalc_and_update() <-- (i) > em_compute_costs() <-- (ii) > em_dev_update_perf_domain() <-- external > > > > Yes, that's correct.