Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4142641pxu; Wed, 9 Dec 2020 09:21:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwdliV9vKgDJbB4Y4wEa1cXUpKYxlcBD1x72UA5UNQPJfdcZRAakv8Ld4UGv4fa0ij2Ko/e X-Received: by 2002:a50:84a9:: with SMTP id 38mr2933779edq.378.1607534499971; Wed, 09 Dec 2020 09:21:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607534499; cv=none; d=google.com; s=arc-20160816; b=quRdVWy2lYUwJ/Gd83to2QGRbvPFRXGG8tmFSNRqQEf2KOrHA2APp9K7qZmE0eFB/h NaWhPxgLelpQDogvIAVLQwiasZQjwDdZeVyRU4Bc7P6zGKpOIQUowOVESEelm0vomP6t sl4239w6dDBOF6LOpK+0Vwhi+cW8gvyYWO0EeWn4FXwueaB9LGGBFvNPIBcC8nRk/wMs us1RpKgPnjweOgotiWGnDb5d3COHX077VwCKNnlpkb2Mw5TwLWybgyL9cW0Mej6iZqaB hhI3fNmsbVZqvx+pumiP3aHXCDmUyZ5AzU9Zso6+PdAviaPnE4qnY10ZWMcUntTMo/eu rdYw== 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=SoQj+QbF0ONNi1OIKLfA3VzTncbES0l8Ii5LI408HQ8=; b=BDknqCIJorIG3YWT7xKI/23/1KqU1x4Dw9kukwY5T7Y6NJp0w/6R2szIgJvjea8S20 raQ+nq7yKD/mha79PkeL9ZF8ZUhoBSXuf7wnvLcXyoTJHXuyVN7FepfGkDX7K+ASlE8U iyJpJXYUESrnjIYS/9El4XIFMv9JuHbLJvgx1MLjkAe3bKZ+aAcF/FGGroFX7Q9yYn9o +MZSFY+XvkslEpxBZW0Yhsh9zhv+lPmEZJw5o/rwMNFtV98Nz6SVA5RyRuCrWieBGOc9 HKYcpEJ49XaDYoqJAAqMWA+gY4dnnSGLiVuIV5Sqy0He/eblPiczi88qiJoXvr/hXLx1 Zm8Q== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si1267918edx.218.2020.12.09.09.21.15; Wed, 09 Dec 2020 09:21:39 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732511AbgLIRSo (ORCPT + 99 others); Wed, 9 Dec 2020 12:18:44 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:35357 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730084AbgLIRSn (ORCPT ); Wed, 9 Dec 2020 12:18:43 -0500 Received: by mail-oi1-f193.google.com with SMTP id s2so2514264oij.2; Wed, 09 Dec 2020 09:18:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SoQj+QbF0ONNi1OIKLfA3VzTncbES0l8Ii5LI408HQ8=; b=I+OqeO+RBIxXXu5EhyA+teu6wKnDTpmn2DWaTiguNlGGLRi8XVx+DOMDrSophB9C8I w52M41uDn7eCAR+bgZmfMHTabgDtZrcZCk15+09jywif8xsUEqrHiiqANs+Yd/4qcM9s do56mTUtBbAtHk2J/gWFo7enz9NeXMjy8Revkyaw/o+8nsV5xMUE+luDZb3jVISrdEu8 W9oJEHznrIpeZkm8ttEYxSxhjtic2GW0fVrK2pHeLFKhsaJJ2xlw4vjK1g478la0Vqg3 Ql1IEsrEYVRE8y3AZimt5uFvzePcjA2tDLprzwVU78D9wEWxFI27+At+iVVoCYr5ttfe rIKg== X-Gm-Message-State: AOAM533HON0EkvTaB1SCWNfYwu+y7AUsePg0piEdykEaMKljAsHiAVGV qcewUB8kSkbDFrFVPSRzer7sCywXS/KuJgki5nw= X-Received: by 2002:aca:5197:: with SMTP id f145mr2532130oib.71.1607534282442; Wed, 09 Dec 2020 09:18:02 -0800 (PST) MIME-Version: 1.0 References: <20360841.iInq7taT2Z@kreacher> <2344038.BgO4qI7qUv@kreacher> <20201208083344.s67kalyxuui3ia4q@vireshk-i7> In-Reply-To: <20201208083344.s67kalyxuui3ia4q@vireshk-i7> From: "Rafael J. Wysocki" Date: Wed, 9 Dec 2020 18:17:51 +0100 Message-ID: Subject: Re: [PATCH v1 1/4] cpufreq: schedutil: Add util to struct sg_cpu To: Viresh Kumar Cc: "Rafael J. Wysocki" , Linux PM , LKML , Srinivas Pandruvada , Peter Zijlstra , Doug Smythies , Giovanni Gherdovich Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 8, 2020 at 9:34 AM Viresh Kumar wrote: > > 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() ? That might be somewhat confusing due to the existing meaning of "update_util". > Otherwise, > > Acked-by: Viresh Kumar Thanks!