Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3007654pxu; Tue, 8 Dec 2020 00:36:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4fpE1p+klrvP/PTYFS8+q+AU5+O1fjuCUiRG7QIpKKgBvDJ0lXj0+bjO/mmzVnhGftSK6 X-Received: by 2002:a17:906:6546:: with SMTP id u6mr23012116ejn.36.1607416610419; Tue, 08 Dec 2020 00:36:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607416610; cv=none; d=google.com; s=arc-20160816; b=TwIE3kECZFAXXCaW1O15G9HaVMb6GuslXEM/XcrN6vVeisN8UUTkQ5uxp+kxOYUhO6 FYdWne2CAFn4kI4PY/oBvmHpS1uNnvFKBQz/PFXAIGW6EQ3YvuMAbeE9HTSePV3ZHqm7 mM1lCm/n6qAyrEGgNq0KCx/X9L5v49jzGeAfKFT3IHe4nwezTrnNmmblGBcp6MKZQ7NV w9RAabKA6Sci67WP1WKXAvlaHJZr9qi7fmZmKxmuglwQLzWfzbLVpBNnY4LmLnuDluKC 966I0j94J8b466xVefhq7Qqy/ZYVJFFyB3EXOXxrZjvuhNTG1FB/h5pzEvaU84sPUcTJ i2kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Gjlk/jLtNyUeazDdibe5U/NgLr5RcEOaHOigFIrgjeQ=; b=cqH12zMuizDXSUOTc9zh2QmKafq48bx2yJAPt8ALA1ewjhuCBZc+DmPAEWMGBGpEMC yuHcC9R1OFXQOJEnV0K34yN64A1aNz85xS5vYHn/Uh9i2/qXyzp1Q/l/VCdFsxkrbBNM 4tB5MFUszNzUjJNdbwKiWyIJAIxPYy74wbv/5hjrrhsirEAJeCGWOEsZvwQXxMG8I+ZE oNMGJ+sbwoyK0va2iansfBzYy2XUX+ctg6Wi1v1YGIzp0AaJj8h1B07Xezeg1CKzW4JW lBpWUkPvseehUmrndVs8YRjS6qB17pIUU/kc4m0/OEqYsigpbaEXo6YL7wbORzK4GjeG NYvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OCylihwq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si11307202edi.362.2020.12.08.00.36.28; Tue, 08 Dec 2020 00:36:50 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=OCylihwq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728117AbgLHIe2 (ORCPT + 99 others); Tue, 8 Dec 2020 03:34:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727943AbgLHIe2 (ORCPT ); Tue, 8 Dec 2020 03:34:28 -0500 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F647C061793 for ; Tue, 8 Dec 2020 00:33:48 -0800 (PST) Received: by mail-pl1-x641.google.com with SMTP id 4so6624929plk.5 for ; Tue, 08 Dec 2020 00:33:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Gjlk/jLtNyUeazDdibe5U/NgLr5RcEOaHOigFIrgjeQ=; b=OCylihwq7Lr5YIGlbD2kaf6/40QC0sTHW78aJsoFmHE03MNa1w24Gwx7iPgKqOuMiW dr1Fs5D8hBgnHMLti9ou6c9x3yky5vgVa72hOXjS6nmiYup1XgMyBr6LPJJhB+t5MxUL 7mqR1RvunHbJ9ijFWcJQe2u+zs60a+3gWFYIb0nEkE/MbHLL0hxR9ZDTaPJqZv0fi8C8 jscJmQ2gm1Wmkc6gdui2bOmIehjxPsmM6yXpSACpZ7jgQ7tQJLfNjs6sFhbyjsPLK6MC XjBRdR9R81z5whkK8AWEg+WDvrp5jDcl/vrjpQEkNWUYnFH37g9O39jzEvm+uJ8qEngU b6xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Gjlk/jLtNyUeazDdibe5U/NgLr5RcEOaHOigFIrgjeQ=; b=pxvk208uhr4hl2Ne3s1w8EUJ3KNHW9EbndxZgVpYYdKrJ7hQbIv044c+2yiUBBrYgW ICHMHjwACFFbW0ljzvvRaNlsPNcnyPnXIq4Ez4Y3euMtNcsiORGPbjK5G4/x0L0drrey 3dM9tnJa1XF/TvqGyF/XnHa//adX924HE7IlfDTU8p0SmAzSRNa4fMvseFAx5RrpNDBI iFsUsyRrFRG+LmMfRrSqt4Eg/GR4qNjtB27jMORbQADpcSUoffD7SKOmlinGJkopdqgz YISkkDV/2DCwBg7X5ofGIwrlLnjAQK7/tC1ZfFtKb32D7tiIDOJxYYyEFxkQ9AbC/q5f 9ztA== X-Gm-Message-State: AOAM530KBZLNdPeaDze42/r2HmKY+fexq/y7+HQZHm+s/uL3y61rncC5 4asBdf/jZIIT2gterB9hTejhug== X-Received: by 2002:a17:902:6b8c:b029:d6:d32e:4a8c with SMTP id p12-20020a1709026b8cb02900d6d32e4a8cmr20100699plk.28.1607416427728; Tue, 08 Dec 2020 00:33:47 -0800 (PST) Received: from localhost ([122.172.136.109]) by smtp.gmail.com with ESMTPSA id k21sm16105066pfu.77.2020.12.08.00.33.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2020 00:33:46 -0800 (PST) Date: Tue, 8 Dec 2020 14:03:44 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM , LKML , Srinivas Pandruvada , Peter Zijlstra , Doug Smythies , Giovanni Gherdovich Subject: Re: [PATCH v1 1/4] cpufreq: schedutil: Add util to struct sg_cpu Message-ID: <20201208083344.s67kalyxuui3ia4q@vireshk-i7> References: <20360841.iInq7taT2Z@kreacher> <2344038.BgO4qI7qUv@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2344038.BgO4qI7qUv@kreacher> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07-12-20, 17:28, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Instead of passing util and max between functions while computing the > utilization and capacity, store the former in struct sg_cpu (along > with the latter and bw_dl). > > This will allow the current utilization value to be compared with the > one obtained previously (which is requisite for some code changes to > follow this one), but also it makes the code look slightly more > consistent and clean. > > Signed-off-by: Rafael J. Wysocki > --- > kernel/sched/cpufreq_schedutil.c | 42 ++++++++++++++++++--------------------- > 1 file changed, 20 insertions(+), 22 deletions(-) > > Index: linux-pm/kernel/sched/cpufreq_schedutil.c > =================================================================== > --- linux-pm.orig/kernel/sched/cpufreq_schedutil.c > +++ linux-pm/kernel/sched/cpufreq_schedutil.c > @@ -53,6 +53,7 @@ struct sugov_cpu { > unsigned int iowait_boost; > u64 last_update; > > + unsigned long util; > unsigned long bw_dl; > unsigned long max; > > @@ -276,16 +277,15 @@ unsigned long schedutil_cpu_util(int cpu > return min(max, util); > } > > -static unsigned long sugov_get_util(struct sugov_cpu *sg_cpu) > +static void sugov_get_util(struct sugov_cpu *sg_cpu) Maybe name it sugov_update_util() ? Otherwise, Acked-by: Viresh Kumar -- viresh