Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5867496rdb; Thu, 14 Dec 2023 01:41:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFvSS4lASKxHeV9AxaF8AHfMUOKRCqEeuL2H4z/xtqbNOWSQ9KbEju8/C6vpvaIgxF8NDpM X-Received: by 2002:a05:6358:6f93:b0:170:f1ac:af13 with SMTP id s19-20020a0563586f9300b00170f1acaf13mr4708020rwn.23.1702546877593; Thu, 14 Dec 2023 01:41:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702546877; cv=none; d=google.com; s=arc-20160816; b=ZcpXx+KIerJ8V7Y0x0xQg7FYZUBq0+CaqTPCM5VIKOnWy9qpn02P+CkQ+lr+WObIf+ cMWVKl1LRMX42EE8eUZM1f8nrJzHv1QRSYmuUrqbNQw3VDID4uKQMnjrVsHM/T00Ma6W mtaNU6CEymu9HEg1z5DX5lFODOIV96o+lE311iBnG6HmE69WSvklPxkbAUfBFMD9h+Lx JY+fJ4YDGdv5ydifyw3CU8yuH9IwhRF68aXEhpqsp1Stad/QcAUz7d5JuwTjYG88BEHE 44v8C8m+8mqt3tGP5CF/1fta7tJOKaq/zK3j3P2uxKurRr+be/EMsXhnBZeqe+H1UxNz Vmpg== 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=GGK6b0MPfTFBPmmrkuukjDK9Sd7fw9TNo/Qr/Mi72+0=; fh=Q2ta9btbyoRCm/ChGrqkBmpJ7iTf2iHYWmaVvilKnQo=; b=jCfuJOpiXSi873/Yd6qwoz84IQnfgKovrCwZUaAQvpnHhIQazngETQyOJheVK+vHXL VeHDdvd3xb8kCMN8c5Kf0UqJXX5ZTz60RGFoHMo6tEs9pAlBKLqhkt+U+M59WmvuTM8k 9pDNev0dPq7NWkC0cvjM28uyiWByVYGQgtbgPjoR5+xFnu/ADoTljLKqF3eRcVEEqdL5 1lvzjyNF/R6NcAXnyCHVT2MakRrEAkN9UmcX+zaCmhoph4rAkxRmPrqCnhnl8C2UYmmM FDDYvub2y6KnguWL4Oqi4oaq313Cv9bQl1hOY11yK8KzdEEZaNDGspKH2i55GoGl4pLs l75w== 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:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id ei21-20020a17090ae55500b0028ad758dad9si3166031pjb.39.2023.12.14.01.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 01:41:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 99A2C80ABFC8; Thu, 14 Dec 2023 01:41:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229666AbjLNJkk convert rfc822-to-8bit (ORCPT + 99 others); Thu, 14 Dec 2023 04:40:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235574AbjLNJkf (ORCPT ); Thu, 14 Dec 2023 04:40:35 -0500 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63ED2127; Thu, 14 Dec 2023 01:40:41 -0800 (PST) Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-6d9db2f1ddfso1264409a34.0; Thu, 14 Dec 2023 01:40:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702546840; x=1703151640; 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=a1OZx1A3Thw17UWY5/qaKbogEfyh83NOJGFEXrtiXrE=; b=WIFVJjQRw7nVqUy4zaojWvKTi/iCqJ5zS69Q5sxAlC1nhPOfTJEkSpTWawsKJZNBBf gX9hN/oHRCzu0HUW1HfzK5aN/3mC3ndVTYyBnJJoO4+xfaEIyobkTAlB08L7yQCt7Lks wF/Tc+uSK/GPuqpsJe8XYPI6UHgVmSQlsWeaxN869lta71kXbsB/FTqx7CSLqFuFlRQi a3naNAo2wUMT2lzMuOhpJKaI+bN9dAZvd8SvB4K2NgZuc+HKOx0hK7bMopbhJsw3ckSe PNL5yLq3VS2qj/NNV9Jg9tXFCATiNdBHY/XU80ginIuOaprDjgwzyTSmdAyFjwWACBGM u/jg== X-Gm-Message-State: AOJu0YyLpR04YY3OR1pyCZ2AVK6BnHa5Uqq+Jkua7F6L46YVeUtE+9xr nhHzzfErC8JNKsf1ZopvHeKspmz9r9NF6gLdjJ0= X-Received: by 2002:a05:6871:2284:b0:1fb:648:5207 with SMTP id sd4-20020a056871228400b001fb06485207mr17709011oab.2.1702546840564; Thu, 14 Dec 2023 01:40:40 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: <54f3b98c-1f7d-4205-9e3c-a4a19ad3d941@arm.com> From: "Rafael J. Wysocki" Date: Thu, 14 Dec 2023 10:40:28 +0100 Message-ID: Subject: Re: [PATCH 1/4] cpufreq: Add a cpufreq pressure feedback for the scheduler To: Lukasz Luba Cc: Vincent Guittot , Viresh Kumar , catalin.marinas@arm.com, will@kernel.org, sudeep.holla@arm.com, rafael@kernel.org, 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 14 Dec 2023 01:41:09 -0800 (PST) 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.