From nobody Sat Sep 13 22:27:31 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DE8FC636CD for ; Sun, 29 Jan 2023 16:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233255AbjA2QPD (ORCPT ); Sun, 29 Jan 2023 11:15:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230076AbjA2QO7 (ORCPT ); Sun, 29 Jan 2023 11:14:59 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 443E71E2B6 for ; Sun, 29 Jan 2023 08:14:58 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id k16so6524954wms.2 for ; Sun, 29 Jan 2023 08:14:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/kxYlHG5oFypkr3pUxTSgVEs+bHMQxU7f8JXM84b6kU=; b=xWPLpgWGnvTZ6YPIRhflVxRly7YPZXXxsbkCDMr1V9tgl3OcDFvX1jB8BCsQvhfWAE AKWiXP2zsYbejjJQZSCvgb76nD6oXvrJdJUNFD1+zhtpUEx6jncBjHvxh94Vvh/1IA7y tOLpgLsOGJPNcEus+SGg9Q7unk+lS1UGdD07UX3+KaQWUa8rZUUHc72tF0OGK29SUu0d qOgfc/TkSl0VJcRH2qdxfdQqZ+hNNaFVz4lVXlgpi6/yvBNf+6dnxnRHGmB5XP5KUQKm hG56PLnLpDBtTY102dJAN8jg5h+dER0yigjHVjxr2nrBey9AlwVGpTlTDBuo2ogYp1/0 1Y3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/kxYlHG5oFypkr3pUxTSgVEs+bHMQxU7f8JXM84b6kU=; b=HUTaJZwPxAWTfjvWfHEwqPG8SZxygP8l9kuR4K0N/g1Tz5UgAHq3bhqQqPFhrjgnST Tq2RslgZY7/7tWSFE8AmF0ufJt5Gwv1ML4iJMINbf70tczqZYx0yDFyfquPIYdccGKZO gdmt2GBX1uMX4Ez4dsMO1cBkNxahhGFrzu7S67mdlNDm/to7NAKJxeb7SPbf6Fbg/Y+w T1oTvPLdEivDV2iLpBhF+atB0thlOQn84xNliHFv+4CoZuCyrkJyFr1mTRhO3LFYTlMh OOLx8nyO3AIEJxkDwXTMZoVzdHddHXlI2D2LlPPmKDhdfPAiw8erd1aN4T8ffzh6SZix lD9g== X-Gm-Message-State: AFqh2krv74zcNXMWhw+4jUQp6mkakzHRTS3rUdhSU5QOxBF+PzhrunpS 3ZCi/HZjdpbGeOPjCWvrvLWyz9Z/A1WP3ZSe X-Google-Smtp-Source: AMrXdXu6gjqIK7PgH1RoeqMCjhcCfC4GKacovTsXQpu5Zak3yTsS9PVrxSkOwNGhA2trKhYX110wHA== X-Received: by 2002:a05:600c:3d16:b0:3cf:8b22:76b3 with SMTP id bh22-20020a05600c3d1600b003cf8b2276b3mr44438418wmb.0.1675008896912; Sun, 29 Jan 2023 08:14:56 -0800 (PST) Received: from localhost.localdomain (host86-163-35-10.range86-163.btcentralplus.com. [86.163.35.10]) by smtp.gmail.com with ESMTPSA id e5-20020a05600c254500b003dc47fb33dasm5324783wma.18.2023.01.29.08.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Jan 2023 08:14:56 -0800 (PST) From: Qais Yousef To: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann Cc: linux-kernel@vger.kernel.org, Lukasz Luba , Wei Wang , Xuewen Yan , Hank , Jonathan JMChen , Qais Yousef Subject: [PATCH 1/3] sched/uclamp: Set max_spare_cap_cpu even if max_spare_cap is 0 Date: Sun, 29 Jan 2023 16:14:42 +0000 Message-Id: <20230129161444.1674958-2-qyousef@layalina.io> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230129161444.1674958-1-qyousef@layalina.io> References: <20230129161444.1674958-1-qyousef@layalina.io> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" When uclamp_max is being used, the util of the task could be higher than the spare capacity of the CPU, but due to uclamp_max value we force fit it there. The way the condition for checking for max_spare_cap in find_energy_efficient_cpu() was constructed; it ignored any CPU that has its spare_cap less than or _equal_ to max_spare_cap. Since we initialize max_spare_cap to 0; this lead to never setting max_spare_cap_cpu and hence ending up never performing compute_energy() for this cluster and missing an opportunity for a better energy efficient placement to honour uclamp_max setting. max_spare_cap =3D 0; cpu_cap =3D capacity_of(cpu) - task_util(p); // 0 if task_util(p) is high ... util_fits_cpu(...); // will return true if uclamp_max forces it to fit ... // this logic will fail to update max_spare_cap_cpu if cpu_cap is 0 if (cpu_cap > max_spare_cap) { max_spare_cap =3D cpu_cap; max_spare_cap_cpu =3D cpu; } prev_spare_cap suffers from a similar problem. Fix the logic by treating -1UL value as 'not populated' instead of 0 which is a viable and correct spare capacity value. Fixes: 1d42509e475c ("sched/fair: Make EAS wakeup placement consider uclamp= restrictions") Signed-off-by: Qais Yousef (Google) --- kernel/sched/fair.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e29e9ea4cde8..ca2c389d3180 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7390,9 +7390,9 @@ static int find_energy_efficient_cpu(struct task_stru= ct *p, int prev_cpu) for (; pd; pd =3D pd->next) { unsigned long util_min =3D p_util_min, util_max =3D p_util_max; unsigned long cpu_cap, cpu_thermal_cap, util; - unsigned long cur_delta, max_spare_cap =3D 0; + unsigned long cur_delta, max_spare_cap =3D -1UL; unsigned long rq_util_min, rq_util_max; - unsigned long prev_spare_cap =3D 0; + unsigned long prev_spare_cap =3D -1UL; int max_spare_cap_cpu =3D -1; unsigned long base_energy; int fits, max_fits =3D -1; @@ -7457,7 +7457,8 @@ static int find_energy_efficient_cpu(struct task_stru= ct *p, int prev_cpu) prev_spare_cap =3D cpu_cap; prev_fits =3D fits; } else if ((fits > max_fits) || - ((fits =3D=3D max_fits) && (cpu_cap > max_spare_cap))) { + ((fits =3D=3D max_fits) && + (cpu_cap > max_spare_cap || max_spare_cap =3D=3D -1UL) { /* * Find the CPU with the maximum spare capacity * among the remaining CPUs in the performance @@ -7469,7 +7470,7 @@ static int find_energy_efficient_cpu(struct task_stru= ct *p, int prev_cpu) } } =20 - if (max_spare_cap_cpu < 0 && prev_spare_cap =3D=3D 0) + if (max_spare_cap_cpu < 0 && prev_spare_cap =3D=3D -1UL) continue; =20 eenv_pd_busy_time(&eenv, cpus, p); @@ -7477,7 +7478,7 @@ static int find_energy_efficient_cpu(struct task_stru= ct *p, int prev_cpu) base_energy =3D compute_energy(&eenv, pd, cpus, p, -1); =20 /* Evaluate the energy impact of using prev_cpu. */ - if (prev_spare_cap > 0) { + if (prev_spare_cap !=3D -1UL) { prev_delta =3D compute_energy(&eenv, pd, cpus, p, prev_cpu); /* CPU utilization has changed */ @@ -7489,7 +7490,8 @@ static int find_energy_efficient_cpu(struct task_stru= ct *p, int prev_cpu) } =20 /* Evaluate the energy impact of using max_spare_cap_cpu. */ - if (max_spare_cap_cpu >=3D 0 && max_spare_cap > prev_spare_cap) { + if (max_spare_cap_cpu >=3D 0 && + (max_spare_cap > prev_spare_cap || prev_spare_cap =3D=3D -1UL)) { /* Current best energy cpu fits better */ if (max_fits < best_fits) continue; --=20 2.25.1 From nobody Sat Sep 13 22:27:31 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D1D4C61D97 for ; Sun, 29 Jan 2023 16:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234767AbjA2QPF (ORCPT ); Sun, 29 Jan 2023 11:15:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230247AbjA2QPB (ORCPT ); Sun, 29 Jan 2023 11:15:01 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06EEB1E288 for ; Sun, 29 Jan 2023 08:15:00 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id f47-20020a05600c492f00b003dc584a7b7eso466208wmp.3 for ; Sun, 29 Jan 2023 08:14:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2tncCBFLnp+WCJ93GE2FIpHlFqL/aCFCr4164wpLh+c=; b=Rm3CR5Bp75dXxPO7Wimt0aVzPrFuobnCYOmm0gvU7xQG4PFCM8yv/0xJuQd61I5+st 3BjcYeQB+nd7XyANCGVkONGJg7S9vckAxLo1aXd4RCQ1tet8wFvroA2LwxUbOQWYOBkO shcoB3nIgDyhBgeZzYa5uwuj+UzJ2+IAkMwTp6FzzQOJ6Q4HVqDfJtw/3lXrgmGc9Qov AjVaJTfdsaubGLguAVMJtGg3TZEGztuzd+K48+t4aatkvO54cDFjqcCogxFBfKSl/UtM l4l9932ZYcGp/gDtD+JxfVsp/rZsT8jzbkImHxb3yFQiSgB5RvDGItyzdPZ1hXOtkMFB pNew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2tncCBFLnp+WCJ93GE2FIpHlFqL/aCFCr4164wpLh+c=; b=DXkPblU2gLXT9VBklFfLtMoTf93X9l52DB/QQ/u8uEpQsW4jX22hqv7/Mxh1oPgK2i 8KLV1JnBrHWIh9SMpgsE88Gv8ZNvID98KPoNnXKGCMP/AlL2Sw8/yCDtkl9j7iiA3Fl2 xCubnJEYkbnqoDd2A/97xe4roYoOdzYQDzUV4MaEwEX6aL1uiowQkIHomVgY3WNgbwn8 A/c1A4wxsXoSHEuTYK1aIZDAnKT7zcqRE7lfZHImI0yurdvwDTD0F4kUYvxu8rsAbp8n rfg4qM/3CM7MwDbGiVqh9vrCTRUssvc35CRAiEMc5IbvggTzT0Prd0HchpFW40o4oAqo f8rA== X-Gm-Message-State: AO0yUKWiLD5aoMQgGIBJ1MKJxVyV/eXUcxWNRP6843Pa7Djj+pulawKF rDYzRT+zKMRDixb/UYtdKWGkfQ== X-Google-Smtp-Source: AK7set/uXlesv/ouQzRQQdFkvS+p2FaBgzyN+RFEohRBjkKByGbxoguBWI8MqobqsRCWKaelj72dVA== X-Received: by 2002:a05:600c:25ca:b0:3dc:46f6:e602 with SMTP id 10-20020a05600c25ca00b003dc46f6e602mr5595238wml.5.1675008898675; Sun, 29 Jan 2023 08:14:58 -0800 (PST) Received: from localhost.localdomain (host86-163-35-10.range86-163.btcentralplus.com. [86.163.35.10]) by smtp.gmail.com with ESMTPSA id e5-20020a05600c254500b003dc47fb33dasm5324783wma.18.2023.01.29.08.14.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Jan 2023 08:14:58 -0800 (PST) From: Qais Yousef To: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann Cc: linux-kernel@vger.kernel.org, Lukasz Luba , Wei Wang , Xuewen Yan , Hank , Jonathan JMChen , Qais Yousef Subject: [PATCH 2/3] sched/uclamp: Ignore (util == 0) optimization in feec() when p_util_max = 0 Date: Sun, 29 Jan 2023 16:14:43 +0000 Message-Id: <20230129161444.1674958-3-qyousef@layalina.io> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230129161444.1674958-1-qyousef@layalina.io> References: <20230129161444.1674958-1-qyousef@layalina.io> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" find_energy_efficient_cpu() bails out early if effective util of the task is 0. When uclamp is being used, this could lead to wrong decisions when uclamp_max is set to 0. Cater for that. Fixes: d81304bc6193 ("sched/uclamp: Cater for uclamp in find_energy_efficie= nt_cpu()'s early exit condition") Signed-off-by: Qais Yousef (Google) --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index ca2c389d3180..3521aad67aa0 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7382,7 +7382,7 @@ static int find_energy_efficient_cpu(struct task_stru= ct *p, int prev_cpu) target =3D prev_cpu; =20 sync_entity_load_avg(&p->se); - if (!uclamp_task_util(p, p_util_min, p_util_max)) + if (!uclamp_task_util(p, p_util_min, p_util_max) && p_util_max !=3D 0) goto unlock; =20 eenv_task_busy_time(&eenv, p, prev_cpu); --=20 2.25.1 From nobody Sat Sep 13 22:27:31 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C6E6C05027 for ; Sun, 29 Jan 2023 16:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234895AbjA2QPI (ORCPT ); Sun, 29 Jan 2023 11:15:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231760AbjA2QPC (ORCPT ); Sun, 29 Jan 2023 11:15:02 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCD621E5D2 for ; Sun, 29 Jan 2023 08:15:01 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id m5-20020a05600c4f4500b003db03b2559eso6605549wmq.5 for ; Sun, 29 Jan 2023 08:15:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ak21MYAOZ7aWgrYAGlhxd83OK7kequIiU355HpFkf1A=; b=ICcjvdpPznFZpudAxu6ViPrqzHSPoc/9oUm7cGZfHr1BNTQ8p0zmrtAWnzoMQj2uhC dM+fF8Uxne0gk0n7XKSKhru6IKPm4xKS7Am0UZqkQ9oB8IjYJQXMUJr9xkgAJjtYLmD6 ZxPi4HsHd2MMMRf4W6Yw5ZZ1dI+tsvxDcKlrJkqj/ZIlbPODQIZOyTizWAjPZeJRno/q kh16KH+XS532GUPYMprXkSfAh+KIfRAqxRaGPr0scUjYCJjDmf6jB7RK3KvRHYIQp1wT rcn4VpZpq9RgFwHbqOJQYt38uCWJ/SGyF3eAVWLVUjuyzRebPqF3dBts6leSYtI8Veqe fiAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ak21MYAOZ7aWgrYAGlhxd83OK7kequIiU355HpFkf1A=; b=jJL2pvE74Uaenb1C7MK86eQx/qNDQujN+6v036e0t+2vpLHNmxUNbrWNC0VnPFWKkd waZLcC5cGoWfhOChgOv3v6qvBxQ0NKuRN0+jprs7lVXz8z2gdcj0O7AWsOdCBzRbpD90 MC9ZetVpMWCDuIf8k2OW5WDnt3leQg/34ElRhfrOyr2u76YhVsJqnF8UZEUQbpADT/f4 Xk8WSS6R3BYnUuI6iyIZvbg0n0lBRZjSofteY3tZeT4okxgd470yPzPVmZ6ql8AHP3+O akq55jc423qsb5UqPeEedjRgjXPCTnoX4+lAYSo0gWCxOkSQ29Y5tmGGFl1IJ/3xOxrj WVJA== X-Gm-Message-State: AFqh2ko/7VftEkEpXiHuEXk2vM2345W1II5nlPSXQG1Ght0T3tyNV3a/ Q7BZgIe+ueQaMLewQEvhn+u+BQ== X-Google-Smtp-Source: AMrXdXvejAaCAN7C6aTeIKUHly/yzfVLPsgdUh9JHwPyVTV9ywIF7h13vrMSNgJmDsdpr3MfGWIN5g== X-Received: by 2002:a7b:ce15:0:b0:3da:2932:b61a with SMTP id m21-20020a7bce15000000b003da2932b61amr47156468wmc.18.1675008900390; Sun, 29 Jan 2023 08:15:00 -0800 (PST) Received: from localhost.localdomain (host86-163-35-10.range86-163.btcentralplus.com. [86.163.35.10]) by smtp.gmail.com with ESMTPSA id e5-20020a05600c254500b003dc47fb33dasm5324783wma.18.2023.01.29.08.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Jan 2023 08:15:00 -0800 (PST) From: Qais Yousef To: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann Cc: linux-kernel@vger.kernel.org, Lukasz Luba , Wei Wang , Xuewen Yan , Hank , Jonathan JMChen , Qais Yousef Subject: [PATCH 3/3] sched/tp: Add new tracepoint to track compute energy computation Date: Sun, 29 Jan 2023 16:14:44 +0000 Message-Id: <20230129161444.1674958-4-qyousef@layalina.io> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230129161444.1674958-1-qyousef@layalina.io> References: <20230129161444.1674958-1-qyousef@layalina.io> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" It was useful to track feec() placement decision and debug the spare capacity and optimization issues vs uclamp_max. Signed-off-by: Qais Yousef (Google) --- include/trace/events/sched.h | 4 ++++ kernel/sched/core.c | 1 + kernel/sched/fair.c | 7 ++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index fbb99a61f714..20cc884f72ff 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -735,6 +735,10 @@ DECLARE_TRACE(sched_update_nr_running_tp, TP_PROTO(struct rq *rq, int change), TP_ARGS(rq, change)); =20 +DECLARE_TRACE(sched_compute_energy_tp, + TP_PROTO(struct task_struct *p, int dst_cpu, unsigned long energy), + TP_ARGS(p, dst_cpu, energy)); + #endif /* _TRACE_SCHED_H */ =20 /* This part must be outside protection */ diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 03b8529db73f..79ad6b8ea93e 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -110,6 +110,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(sched_overutilized_tp); EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_cfs_tp); EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_se_tp); EXPORT_TRACEPOINT_SYMBOL_GPL(sched_update_nr_running_tp); +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_compute_energy_tp); =20 DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); =20 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3521aad67aa0..3b55dbb0fcfe 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7303,11 +7303,16 @@ compute_energy(struct energy_env *eenv, struct perf= _domain *pd, { unsigned long max_util =3D eenv_pd_max_util(eenv, pd_cpus, p, dst_cpu); unsigned long busy_time =3D eenv->pd_busy_time; + unsigned long energy; =20 if (dst_cpu >=3D 0) busy_time =3D min(eenv->pd_cap, busy_time + eenv->task_busy_time); =20 - return em_cpu_energy(pd->em_pd, max_util, busy_time, eenv->cpu_cap); + energy =3D em_cpu_energy(pd->em_pd, max_util, busy_time, eenv->cpu_cap); + + trace_sched_compute_energy_tp(p, dst_cpu, energy); + + return energy; } =20 /* --=20 2.25.1