Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp12131622rwl; Tue, 3 Jan 2023 09:25:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXtInTN/CtTpcrQqz+LeTHvDiOxlWHTjRPBOw2YeE5Y9i95SKrPWkc+BxvLfETlmMhDg82R7 X-Received: by 2002:a62:6102:0:b0:578:3bc0:57d7 with SMTP id v2-20020a626102000000b005783bc057d7mr44169243pfb.13.1672766729760; Tue, 03 Jan 2023 09:25:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672766729; cv=none; d=google.com; s=arc-20160816; b=gnxGJ0jwv37AYgqmFaQ7EqtzQhfWYuEog3A2XCI1z85pHZ/HK9+6SUZTKOIDoXeolM x++xPnEbWZG//XuQMDtJVSRXsw9g16LkHsYLrV9sbuA3/BXQjt80EajLiiQyPhPkNRXn nOXm1L3B2BEoqV7hRWhVbZ7IZBtiLMvhGl1n2ewiZgxUzwaRNPN4ud4ZfCS7Ka/mg3Q5 JzY81TOfwCS7Dmn09R2b6hb0DaF3hql4vSyLUYLnJ9uF7baH8EzO7doRf4F6WOns3YWO STw2sevdCExSYrF1a/uctf8E4zRnzf/haZ6W4wCzpPhoKdic/JJg+qNHWyHFfXx9jogx yHww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=qCeNXkeIIS+L0VcS+kfcmiGxNLxFEc/bLfFVeu53wUM=; b=jMghNXO6f7pir8a8c9jcQXCLEtTFwIN4FQHX6hbnxy+8RWYTe8WNR4rcJM+wawG1Ls FK32YH5DGgttwiXzdewkWIZl29PoCr72A90Bz9a9a0GnQ7BgYvyMOEpTDKDLcoF0m9ZX XqeiqVUOo5qwXvERDI74CVb+3ZYAMbCTwhUb2+AJTz+KlzKrokJWi8/BzILwHXkAtVsi N6UHmLeFILh86gyi/niHxeLhGdmdRXT0Xltcm0ScdzaDml5dLdqkzc+amIokhoHsBf3/ JNDb/PPiPVt4WpMhaeQU20K4dlfvTtoshY8Kb7jEfVHTtOBnKfONDfnE4wpC7VP2rG3I laIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s21-20020a056a00195500b005770e7ca31asi35303023pfk.239.2023.01.03.09.25.22; Tue, 03 Jan 2023 09:25:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233409AbjACRMc (ORCPT + 60 others); Tue, 3 Jan 2023 12:12:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238359AbjACRLc (ORCPT ); Tue, 3 Jan 2023 12:11:32 -0500 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35D3613F72; Tue, 3 Jan 2023 09:08:58 -0800 (PST) Received: by mail-ej1-f48.google.com with SMTP id m18so75358057eji.5; Tue, 03 Jan 2023 09:08:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=qCeNXkeIIS+L0VcS+kfcmiGxNLxFEc/bLfFVeu53wUM=; b=RDGsjEHh96V3h//7ftm+DwvQ/ukeAjtS3IE7XkzID3GEaG3iD0suUUNuFHEmBxNIDn L/XFXmc95eR72EVmcVqDdY2dkFUD+mM/Y/u9gI+dT4Ullg0UkCHK5/imAmT0mX72E9pK 2Hf+iMxqkC8RQs5pzX3Bj/vlOf+DjZ4e+bS9jFGBaAH+ppnS7/AKFEqWMNc4diR+SMju FbKilFMYpLWKRkMHH6lNCjZAeypZEoEQa0VxDJX9z/EkG3yvteyyaDbLG1Ncv18ypoGm 6UXiC165PdY0CLi1HGtHsJgPzRBWHnRirJaAYv0pOGobQvGKS9tqAyJvJDkRYNDFYLfP 4S7Q== X-Gm-Message-State: AFqh2kpqQuDBUxCuakuLXcJDlnw+E3cB+xVMjnQbdceLWswmYR3adxU7 ssQ3zltn/MMhf3fMVhScjzkCLXB7qFKehN6J/Og= X-Received: by 2002:a17:907:7665:b0:843:770e:7787 with SMTP id kk5-20020a170907766500b00843770e7787mr3611075ejc.79.1672765736732; Tue, 03 Jan 2023 09:08:56 -0800 (PST) MIME-Version: 1.0 References: <20221130153204.2085591-1-kajetan.puchalski@arm.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 3 Jan 2023 18:08:45 +0100 Message-ID: Subject: Re: [RFC PATCH v5 0/2] cpuidle: teo: Introduce util-awareness To: Kajetan Puchalski Cc: rafael@kernel.org, daniel.lezcano@linaro.org, lukasz.luba@arm.com, Dietmar.Eggemann@arm.com, dsmythies@telus.net, yu.chen.surf@gmail.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 3, 2023 at 3:22 PM Kajetan Puchalski wrote: > > On Wed, Nov 30, 2022 at 03:32:02PM +0000, Kajetan Puchalski wrote: > > Hi Rafael, > > As it's been a while since the last email I wanted to bump this thread > and ask what you think about the last changes. Right, I'll send my comments on the last version of the patch separately. > Additionally, I got some emails from the kernel test robot and noticed > that sched_cpu_util is contingent on CONFIG_SMP so in the current form > there's build errors on !SMP machines. > > The following change should fix the problem, do you think it's all right to add? > > @@ -207,10 +207,17 @@ static DEFINE_PER_CPU(struct teo_cpu, teo_cpus); > * @dev: Target CPU > * @cpu_data: Governor CPU data for the target CPU > */ > +#ifdef CONFIG_SMP > static void teo_get_util(struct cpuidle_device *dev, struct teo_cpu *cpu_data) > { > cpu_data->utilized = sched_cpu_util(dev->cpu) > cpu_data->util_threshold; > } > +#else > +static void teo_get_util(struct cpuidle_device *dev, struct teo_cpu *cpu_data) > +{ > + cpu_data->utilized = false; > +} > +#endif > IMV it would be better to use teo_cpu_is_utilized() that would be called to update cpu_data->utilized this way cpu_data->utilized = teo_cpu_is_utilized(dev->cpu, cpu_data->util_threshold); and define it as an empty stab in the !SMP case.