Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp425222ybg; Tue, 28 Jul 2020 09:19:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbDDqJrj8YnEmb8yUD/e7X3FpIyFuyknNQTMtd+PYou+RSldbLnaA9s7EcsJ9aepwuAiFL X-Received: by 2002:aa7:db4f:: with SMTP id n15mr26241606edt.193.1595953142971; Tue, 28 Jul 2020 09:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595953142; cv=none; d=google.com; s=arc-20160816; b=L3/R575Gztd6nPPkbgVUeSfrPsa11IT8woq9gtFihqxda5D1GJvoxkJF7SsHoODNEq viYwGI1IPkDzZOD59dV2IVr5iE03OhW2BmndullrSGiymKVE7WmP95zVANX0HXUVSm3e iBvAC9N/EJAVeyf3109PvHYzG2gSwWaram23Zf0j4hk+WsBurEeM0mxD9ByC+3kqb14G 1g6C0uDMhOZglsimHoSkZfXOa6OdIP5yprtNN9k/slPdZkZ+0noD67Vv/5Apz1ZcRnG4 +YoDsb/eYddd9JwKVAaqrhmJwEicCtvYqTZ2U2YZUVdJKnQAtpnbn7H4p61T2IU/Ziee /dXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=w/MyNsYNSzWEtahpywqz4IlTMy+FUjsPilWbPgwtvWU=; b=rCiB5hm1GkqrjGehW8D7pcxuLTFCyenSNUY7Oio+Mlnl9sd0wnDBJQQTC+w3eBDWZo /guy7QzXL0zfbkI5tZ1vkxJm9KUp/7Cb4PYkT6YXjGZfvhSE4nJgx7aactuUWKCPOiOk MAr1xLy4yDl3mn4wYOv/x5v6dNVdhcvuALgIcCnwRpvBCrmtFgiqWXKRnm6qzS49tmCT ujIKN3k0XXXvkmMP8Yh8oNiKsx8KNpLy2ODh5WztkixjretgzJIjI/y0MjNzqnwTSYNV 39hiE5iPk6lzT7OC7Hulv0fnFtB9p2qSPfVTrwzCphW++77dUU40Qqs3dFg36Y0FwsqX wvWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr6si9851060ejc.638.2020.07.28.09.18.39; Tue, 28 Jul 2020 09:19:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731349AbgG1QRD (ORCPT + 99 others); Tue, 28 Jul 2020 12:17:03 -0400 Received: from foss.arm.com ([217.140.110.172]:37808 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730556AbgG1QRD (ORCPT ); Tue, 28 Jul 2020 12:17:03 -0400 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 E3D4B31B; Tue, 28 Jul 2020 09:17:01 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0E2193F718; Tue, 28 Jul 2020 09:16:59 -0700 (PDT) References: <20200712165917.9168-1-valentin.schneider@arm.com> <20200712165917.9168-3-valentin.schneider@arm.com> <20200727141825.GA4174@lca.pw> <16f8c1d4-778b-3ab8-f328-bae80f3973b4@arm.com> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: Dietmar Eggemann Cc: Qian Cai , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, Russell King , Thara Gopinath , Sudeep Holla , Amit Daniel Kachhap , Daniel Lezcano , Viresh Kumar , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot Subject: Re: [PATCH v2 2/3] sched: Cleanup SCHED_THERMAL_PRESSURE kconfig entry In-reply-to: <16f8c1d4-778b-3ab8-f328-bae80f3973b4@arm.com> Date: Tue, 28 Jul 2020 17:16:57 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 27/07/20 18:45, Dietmar Eggemann wrote: > On 27/07/2020 16:18, Qian Cai wrote: >> On Sun, Jul 12, 2020 at 05:59:16PM +0100, Valentin Schneider wrote: >>> As Russell pointed out [1], this option is severely lacking in the >>> documentation department, and figuring out if one has the required >>> dependencies to benefit from turning it on is not straightforward. >>> >>> Make it non user-visible, and add a bit of help to it. While at it, make it >>> depend on CPU_FREQ_THERMAL. >>> >>> [1]: https://lkml.kernel.org/r/20200603173150.GB1551@shell.armlinux.org.uk >>> >>> Signed-off-by: Valentin Schneider >>> --- >>> init/Kconfig | 15 ++++++++++++++- >>> 1 file changed, 14 insertions(+), 1 deletion(-) >>> >>> diff --git a/init/Kconfig b/init/Kconfig >>> index 0498af567f70..0a97d85568b2 100644 >>> --- a/init/Kconfig >>> +++ b/init/Kconfig >>> @@ -492,8 +492,21 @@ config HAVE_SCHED_AVG_IRQ >>> depends on SMP >>> >>> config SCHED_THERMAL_PRESSURE >>> - bool "Enable periodic averaging of thermal pressure" >>> + bool >>> depends on SMP >>> + depends on CPU_FREQ_THERMAL >>> + help >>> + Select this option to enable thermal pressure accounting in the >>> + scheduler. Thermal pressure is the value conveyed to the scheduler >>> + that reflects the reduction in CPU compute capacity resulted from >>> + thermal throttling. Thermal throttling occurs when the performance of >>> + a CPU is capped due to high operating temperatures. >>> + >>> + If selected, the scheduler will be able to balance tasks accordingly, >>> + i.e. put less load on throttled CPUs than on non/less throttled ones. >>> + >>> + This requires the architecture to implement >>> + arch_set_thermal_pressure() and arch_get_thermal_pressure(). >>> >>> config BSD_PROCESS_ACCT >>> bool "BSD Process Accounting" >>> -- >> >> On arm64 linux-next (20200727), >> >> https://gitlab.com/cailca/linux-mm/-/blob/master/arm64.config >> >> WARNING: unmet direct dependencies detected for SCHED_THERMAL_PRESSURE >> Depends on [n]: SMP [=y] && CPU_FREQ_THERMAL [=n] >> Selected by [y]: >> - ARM64 [=y] > > Not sure, but: > > (1) do we wan to let people enable SCHED_THERMAL_PRESSURE for arm64 so > arm64 can potentially run w/o a CPU freq cooling device? > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 2d4abbc9f8d0..baffe8b66da2 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -192,7 +192,6 @@ config ARM64 > select PCI_SYSCALL if PCI > select POWER_RESET > select POWER_SUPPLY > - select SCHED_THERMAL_PRESSURE > select SPARSE_IRQ > select SWIOTLB > select SYSCTL_EXCEPTION_TRACE > diff --git a/init/Kconfig b/init/Kconfig > index 37b089f87804..8b36e07fb230 100644 > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -492,7 +492,7 @@ config HAVE_SCHED_AVG_IRQ > depends on SMP > > config SCHED_THERMAL_PRESSURE > - bool > + bool "Thermal pressure accounting" > depends on SMP > depends on CPU_FREQ_THERMAL > help > > Or > > (2) should SCHED_THERMAL_PRESSURE for arm64 be enabled by default? > > But then it makes no sense to allow the removal of CONFIG_CPU_FREQ_THERMAL. > > linux-next/master$ make ARCH=arm64 defconfig > > // Remove CONFIG_CPU_FREQ_THERMAL > linux-next/master$ grep CPU_FREQ_THERMAL .config > # CONFIG_CPU_FREQ_THERMAL is not set > > linux-next/master$ make > scripts/kconfig/conf --syncconfig Kconfig > > WARNING: unmet direct dependencies detected for SCHED_THERMAL_PRESSURE > Depends on [n]: SMP [=y] && CPU_FREQ_THERMAL [=n] > Selected by [y]: > - ARM64 [=y] > > WARNING: unmet direct dependencies detected for SCHED_THERMAL_PRESSURE > Depends on [n]: SMP [=y] && CPU_FREQ_THERMAL [=n] > Selected by [y]: > - ARM64 [=y] > > WARNING: unmet direct dependencies detected for SCHED_THERMAL_PRESSURE > Depends on [n]: SMP [=y] && CPU_FREQ_THERMAL [=n] > Selected by [y]: > - ARM64 [=y] > HOSTCC scripts/dtc/dtc.o > > --- > > There is a similar issue with arm. > > I would prefer for (1). I went for having SCHED_THERMAL_PRESSURE in arm64/Kconfig because of where the discussion went in the original thread ([1] in the changelog). One point is that selecting this option requires having the right infrastructure in place (arch_{set, scale}_thermal_pressure() must be redefined by the architecture), which cannot be easily expressed in Kconfig terms. Russell's point was that this is difficult for a lambda user to make sense of, and Vincent argued that this option should simply be selected at architecture level, which, given the context, makes sense IMO. We could change the arch Kconfig into select SCHED_THERMAL_PRESSURE if CPU_FREQ_THERMAL but that seems redundant; this dependency is already expressed in SCHED_THERMAL_PRESSURE's definition. Is there a proper pattern to select some Kconfig option only if all of its dependencies are met?