Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5891534rdb; Thu, 14 Dec 2023 02:40:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEa9YKG109SYgO1pYz9QNTLsn5FSY379lqAZVQu70tr5qthWcLWimcWWw6nn6/T/IfTATak X-Received: by 2002:a05:6a20:9711:b0:18f:97c:9296 with SMTP id hr17-20020a056a20971100b0018f097c9296mr4873887pzc.123.1702550426666; Thu, 14 Dec 2023 02:40:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702550426; cv=none; d=google.com; s=arc-20160816; b=P0HGUscYMJbfqQSnGwpIIJHFw9A0kYcrOvlInBMwhn89jfVNA/WpBCZ8J72jV2dwpM /ko4WnczyIATbBjRbneqt/KrTIsDzS7b5mHmUmLbDKxVIqpAh4QfU6+kl6GGb8ZdmMZp lEbpX+6JmU9jjXmspdi4qRTlFX/l8E7/ahybXgToEQ1ljWGUsegsGeff9wju5Rezm4qL aPUxI3SubrxB1A0ag4UiI8dbwUEhKI8Qr4Ytp6UKWmwcSejPe3sB35lelorhLzOLdJUR RoJFWFlEt79fZePmrfg9qLjLQ6KkLB+6foYPqQcVO5MLUWR0cHB/9NK5L9hjsL88TjFy rfKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=tvCRAUXCXN2sL3y4ooNVfdultyoYkPao4fSxwEiIVmo=; fh=7MtiVRlWJ1r43uAsRAED5LENJIEketNltmXRRWatrXA=; b=L8dvsPOaPHb1ZZU08DdIeGzFdzEEiO/Rm3kmhRiKVmScUAceppw3XfdiOh5Xc+NbLX 4njaQGql0wLqeIOhzfy3yRWRqgPAomrOQ1VIR2pmLxfTdPi/BfuhWo3S0E9riCytV3x3 +sedqdxDOcptaxayhfZlc0I1r/BfkLgnWA43ci4CVR+WvF8F5AOaRl2Uis6MLOU1+1rO cFg7bPSzQrfdYK+4+3Vrc/R80pOLTuXFNJRsV1dqEePVuf0EG8Kj4k078y3WI4eFq+Wa IlkBseXDsJIh7KoE8FyA7wvgJrWd5B6SCTchBJPjK6JlZdHLN1NMNbLF4oYqfz7rRtn5 iyEQ== 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:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id o10-20020a170902778a00b001d34a9f57a5si2879687pll.314.2023.12.14.02.40.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 02:40:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3AB5F807384F; Thu, 14 Dec 2023 02:40:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443711AbjLNKkD (ORCPT + 99 others); Thu, 14 Dec 2023 05:40:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443694AbjLNKkC (ORCPT ); Thu, 14 Dec 2023 05:40:02 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8FBAC11B; Thu, 14 Dec 2023 02:40:07 -0800 (PST) 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 B5180C15; Thu, 14 Dec 2023 02:40:52 -0800 (PST) Received: from [10.57.85.242] (unknown [10.57.85.242]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B810C3F738; Thu, 14 Dec 2023 02:40:02 -0800 (PST) Message-ID: Date: Thu, 14 Dec 2023 10:41:05 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/4] cpufreq: Add a cpufreq pressure feedback for the scheduler Content-Language: en-US To: "Rafael J. Wysocki" Cc: Vincent Guittot , Viresh Kumar , catalin.marinas@arm.com, will@kernel.org, sudeep.holla@arm.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, rui.zhang@intel.com, mhiramat@kernel.org, daniel.lezcano@linaro.org, amit.kachhap@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-trace-kernel@vger.kernel.org References: <20231212142730.998913-1-vincent.guittot@linaro.org> <20231212142730.998913-2-vincent.guittot@linaro.org> <20231214054307.axl33gagxacidjbn@vireshk-i7> <54f3b98c-1f7d-4205-9e3c-a4a19ad3d941@arm.com> From: Lukasz Luba In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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]); Thu, 14 Dec 2023 02:40:19 -0800 (PST) On 12/14/23 09:40, Rafael J. Wysocki wrote: > On Thu, Dec 14, 2023 at 10:07 AM Lukasz Luba wrote: >> >> On 12/14/23 07:57, Vincent Guittot wrote: >>> On Thu, 14 Dec 2023 at 06:43, Viresh Kumar wrote: >>>> >>>> On 12-12-23, 15:27, Vincent Guittot wrote: >>>>> @@ -2618,6 +2663,9 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, >>>>> policy->max = __resolve_freq(policy, policy->max, CPUFREQ_RELATION_H); >>>>> trace_cpu_frequency_limits(policy); >>>>> >>>>> + cpus = policy->related_cpus; >>>>> + cpufreq_update_pressure(cpus, policy->max); >>>>> + >>>>> policy->cached_target_freq = UINT_MAX; >>>> >>>> One more question, why are you doing this from cpufreq_set_policy ? If >>>> due to cpufreq cooling or from userspace, we end up limiting the >>>> maximum possible frequency, will this routine always get called ? >>> >>> Yes, any update of a FREQ_QOS_MAX ends up calling cpufreq_set_policy() >>> to update the policy->max >>> >> >> Agree, cpufreq sysfs scaling_max_freq is also important to handle >> in this new design. Currently we don't reflect that as reduced CPU >> capacity in the scheduler. There was discussion when I proposed to feed >> that CPU frequency reduction into thermal_pressure [1]. >> >> The same applies for the DTPM which is missing currently the proper >> impact to the CPU reduced capacity in the scheduler. >> >> IMHO any limit set into FREQ_QOS_MAX should be visible in this >> new design of capacity reduction signaling. >> >> [1] https://lore.kernel.org/lkml/20220930094821.31665-2-lukasz.luba@arm.com/ > > Actually, freq_qos_read_value(&policy->constraints, FREQ_QOS_MAX) will > return the requisite limit. Yes, but we need to translate that information from freq domain into capacity domain and plumb ii into scheduler as stolen CPU capacity. Ideally, w/o any 'smoothing' but just instant value. That's the hope of this patch set re-design.