Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp313642lqp; Wed, 12 Jun 2024 02:21:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMz1OhrjLk7Op3lqEQJ5qP9584IArEeUsKeSe0fkHsbhyWpUYzzmBt1hjEd05l01EVgyJ/tNjV6jaNpxvRkpLJRgW/uhxWy4uLbGlloA== X-Google-Smtp-Source: AGHT+IF4vAx64NbJzwm4VkzLNnZWuKK8SkRtRfxVOYBq5SpBiB89l1GPtjYw9Y6by/7OTH40WoE6 X-Received: by 2002:a05:6808:1b0f:b0:3d2:1c5c:b22f with SMTP id 5614622812f47-3d23e0a407emr1300018b6e.2.1718184070882; Wed, 12 Jun 2024 02:21:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718184070; cv=pass; d=google.com; s=arc-20160816; b=DFxmsungGZPQ3zJ90ueNbBC4P31fDlxSZsWI5bKoOK2emkOxM6nfmqwNWf/Y9OhIzx aMWov0R/6QgWxRVEfvDNZ9QCCcGMvntJLhPVYiQDA2Zi1AfADhjZ3X5Nx5uNTx51tvKb 7TI0hclUp4iIuEbG9VRVOjyUFZBGu8b5E+pAZ08bJiu2ggQmMsQDfH61ocGDRsc+Xw5y 3amAhGNf08WiY6MAD2zCPDMhH3yYYN4HkjECsnjjvwR8YeSnRmy5WKV8TdzPvUbx823b H36AU89gO4m+8wByjYbee6TmxPO20TLmDsf4Auru5MS8BGf3Op8YoAMscvb5qrI7fhUt d28w== 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=cD2bXJ9OyODhNiDPrQS+mzAqeCYYiifn4dztB0n9vNo=; fh=w3n0px23fEUn4nQPKiOJ35NgZZIqUtNRibOTz1QKyKc=; b=hI7MMzL+Uf2r6oPxn4O7ztNHqNanwhHyqjHYlJOZeaHOFI/CJnnYmco6Mur7LmZUGY DxpoS9DUF+wU+zwCOm34PSJuijKudwURS9f++uhQR9naFCX9Tk+P5ig9jxnyR2gmcDVy EUfsuUAnUUNKXdvb+z3wi1RyAZwM4HiHpuIXHTFcDGR+/ghp6yuCbVV4IcAf77KPlNRW mtpcg2084Su6eQVg3WgqcI1EjzlBsVcMR4MD1tZRWyCPeLWGCd8qnNZg6v8UViMUP80N cxcEnwWb8f/gQRHVRpgycOU7w0bmSi5nghQC3Cddgj7N/04ffqOpvsP6eIB2ZoyIRgDN bwBw==; 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-211246-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211246-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de262c033esi7123432a12.360.2024.06.12.02.21.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 02:21:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211246-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-211246-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211246-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 1F7FC2828EF for ; Wed, 12 Jun 2024 09:17:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B19E16D9CB; Wed, 12 Jun 2024 09:17:01 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C24516D9B4; Wed, 12 Jun 2024 09:16:57 +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=1718183820; cv=none; b=cWmYsVi6czMUZCMtT8JKgYEyfJIY8TjX0UJaQgcZGRDhniRZVk7UAnp1he3vjQ3H9K0XGy19Hs1BJIcGew6lzb9Rf/kN6cVvo+M8euElFJWgRirXns7SiScGlami6V7ACqnFtnHXIEDdOQc7EWEojw2tBhRqam86SGbL6QMyd38= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718183820; c=relaxed/simple; bh=dPtpzMUg9r4ZGtEGnGWWRzJdU22xe0lzZMle/MKPde0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oJAR40sGh3Bb2UeDjdKfc66SBEmKKxniO5BV48Lu1IlhIy3fTYOI+7KoKkXxx0xjZhP+Mo/uV7thlIOu1eB0KPy23234wkGzXcmPS7QPoiZMByWJIh9JAkiTV/xv6cSGBDch3j8p3l9DU4ZfwpKzyX+Z09iDkd9+SMVFxWPYsc8= 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 0286D1595; Wed, 12 Jun 2024 02:17:22 -0700 (PDT) Received: from [10.57.72.106] (unknown [10.57.72.106]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8F2A43F64C; Wed, 12 Jun 2024 02:16:55 -0700 (PDT) Message-ID: <7ba09d9e-61dc-4d36-a401-0f89915fadfb@arm.com> Date: Wed, 12 Jun 2024 10:17:04 +0100 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: [PATCH v6 2/2] cpuidle: teo: Introduce util-awareness To: Vincent Guittot Cc: Kajetan Puchalski , rafael@kernel.org, daniel.lezcano@linaro.org, Dietmar.Eggemann@arm.com, dsmythies@telus.net, yu.chen.surf@gmail.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Ulf Hansson , Qais Yousef References: <20230105145159.1089531-1-kajetan.puchalski@arm.com> <20230105145159.1089531-3-kajetan.puchalski@arm.com> <20230711175814.zfavcn7xn3ia5va4@airbuntu> <20230718132432.w5xoxbqm54jmu6n5@airbuntu> <20230917010516.54dgcmms44wyfrvx@airbuntu> <286d4cf8-814b-41a2-8d5f-2673dc737f45@arm.com> Content-Language: en-US From: Lukasz Luba In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/12/24 10:04, Vincent Guittot wrote: > On Wed, 12 Jun 2024 at 09:25, Lukasz Luba wrote: >> >> Hi Vincent, >> >> My apologies for delay, I was on sick leave. >> >> On 5/28/24 15:07, Vincent Guittot wrote: >>> On Tue, 28 May 2024 at 11:59, Lukasz Luba wrote: >>>> >>>> Hi Vincent, >>>> >>>> On 5/28/24 10:29, Vincent Guittot wrote: >>>>> Hi All, >>>>> >>>>> I'm quite late on this thread but this patchset creates a major >>>>> regression for psci cpuidle driver when using the OSI mode (OS >>>>> initiated mode). In such a case, cpuidle driver takes care only of >>>>> CPUs power state and the deeper C-states ,which includes cluster and >>>>> other power domains, are handled with power domain framework. In such >>>>> configuration ,cpuidle has only 2 c-states : WFI and cpu off states >>>>> and others states that include the clusters, are managed by genpd and >>>>> its governor. >>>>> >>>>> This patch selects cpuidle c-state N-1 as soon as the utilization is >>>>> above CPU capacity / 64 which means at most a level of 16 on the big >>>>> core but can be as low as 4 on little cores. These levels are very low >>>>> and the main result is that as soon as there is very little activity >>>>> on a CPU, cpuidle always selects WFI states whatever the estimated >>>>> sleep duration and which prevents any deeper states. Another effect is >>>>> that it also keeps the tick firing every 1ms in my case. >>>> >>>> Thanks for reporting this. >>>> Could you add what regression it's causing, please? >>>> Performance or higher power? >>> >>> It's not a perf but rather a power regression. I don't have a power >>> counter so it's difficult to give figures but I found it while running >>> a unitary test below on my rb5: >>> run 500us every 19457ms on medium core (uclamp_min: 600). >> >> Mid cores are built differently, they have low static power (leakage). >> Therefore, for them the residency in deeper idle state should be >> longer than for Big CPU. When you power off the CPU you loose your >> cache data/code. The data needs to be stored in the L3 or >> further memory. When the cpu is powered on again, it needs code & data. >> Thus, it will transfer that data/code from L3 or from DDR. That >> information transfer has energy cost (it's not for free). The cost >> of data from DDR is very high. >> Then we have to justify if the energy lost while sleeping in shallower >> idle state can be higher than loading data/code from outside. >> For different CPU it would be different. > > I'm aware of these points and the residency time of an idle state is > set to reflect this cost. In my case, the idle time is far above the > residency time which means that we should get some energy saving. > cpu off 4.488ms > cluster off 9.987ms > vs > sleep duration 18.000ms > > Also, the policy of selecting a shallower idle state than the final > selected one doesn't work with PSCI OSI because cpuidle is only aware > of per CPU idle states but it is not aware of the cluster or > deeper/wider idle states so cpuidle doesn't know what will be the > final selected idle state. This is a major problem, in addition to > keep the tick firing I think we are aligned with this. Something has to change in this implementation of idle gov. I'm a bit more skeptical about your second point with PSCI. That standard might be to strong to change.