From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A0DCC07E85 for ; Tue, 11 Dec 2018 12:17:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F272B20811 for ; Tue, 11 Dec 2018 12:17:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F272B20811 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726298AbeLKMRw (ORCPT ); Tue, 11 Dec 2018 07:17:52 -0500 Received: from foss.arm.com ([217.140.101.70]:46098 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbeLKMRv (ORCPT ); Tue, 11 Dec 2018 07:17:51 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D7710EBD; Tue, 11 Dec 2018 04:17:50 -0800 (PST) Received: from queper01-lin (queper01-lin.cambridge.arm.com [10.1.195.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BB0C03F6A8; Tue, 11 Dec 2018 04:17:46 -0800 (PST) Date: Tue, 11 Dec 2018 12:17:45 +0000 From: Quentin Perret To: "Rafael J. Wysocki" Cc: Peter Zijlstra , "Rafael J. Wysocki" , Linux Kernel Mailing List , Linux PM , Greg Kroah-Hartman , Ingo Molnar , Dietmar Eggemann , Morten Rasmussen , Chris Redpath , Patrick Bellasi , Valentin Schneider , Vincent Guittot , Thara Gopinath , Viresh Kumar , Todd Kjos , Joel Fernandes , Steve Muckle , adharmap@codeaurora.org, Saravana Kannan , Pavan Kondeti , Juri Lelli , Eduardo Valentin , Srinivas Pandruvada , currojerez@riseup.net, Javi Merino Subject: Re: [PATCH v10 02/15] sched/cpufreq: Prepare schedutil for Energy Aware Scheduling Message-ID: <20181211121742.d6ujfyccwn7t63b3@queper01-lin> References: <20181203095628.11858-1-quentin.perret@arm.com> <20181203095628.11858-3-quentin.perret@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rafael, On Tuesday 11 Dec 2018 at 13:01:24 (+0100), Rafael J. Wysocki wrote: > On Mon, Dec 3, 2018 at 10:56 AM Quentin Perret wrote: > > [cut] > > > #ifdef CONFIG_CPU_FREQ_GOV_SCHEDUTIL > > +/** > > + * enum schedutil_type - CPU utilization type > > + * @FREQUENCY_UTIL: Utilization used to select frequency > > + * @ENERGY_UTIL: Utilization used during energy calculation > > + * > > + * The utilization signals of all scheduling classes (CFS/RT/DL) and IRQ time > > + * need to be aggregated differently depending on the usage made of them. This > > + * enum is used within schedutil_freq_util() to differentiate the types of > > + * utilization expected by the callers, and adjust the aggregation accordingly. > > + */ > > +enum schedutil_type { > > + FREQUENCY_UTIL, > > + ENERGY_UTIL, > > +}; > > Why not to use bool instead of this? Do you expect to have more than > just two values in the future? If so, what would be the third one? Indeed, the only reason is that an enum is easier to extend, if need be. I think you mentioned some time ago that CPUIdle could be, in principle, interested in having access to aggregated utilization signals of CPUs: https://lore.kernel.org/lkml/CAJZ5v0j=EYnANGAj9bd44eeux1eCfeMtdn9npe5pSAzE8EVKaA@mail.gmail.com/ So yeah, I kept Peter's original enum and went for documenting the type, as you suggested on v7 :-) Thanks, Quentin From mboxrd@z Thu Jan 1 00:00:00 1970 From: Quentin Perret Subject: Re: [PATCH v10 02/15] sched/cpufreq: Prepare schedutil for Energy Aware Scheduling Date: Tue, 11 Dec 2018 12:17:45 +0000 Message-ID: <20181211121742.d6ujfyccwn7t63b3@queper01-lin> References: <20181203095628.11858-1-quentin.perret@arm.com> <20181203095628.11858-3-quentin.perret@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: "Rafael J. Wysocki" Cc: Peter Zijlstra , "Rafael J. Wysocki" , Linux Kernel Mailing List , Linux PM , Greg Kroah-Hartman , Ingo Molnar , Dietmar Eggemann , Morten Rasmussen , Chris Redpath , Patrick Bellasi , Valentin Schneider , Vincent Guittot , Thara Gopinath , Viresh Kumar , Todd Kjos , Joel Fernandes , Steve Muckle , adharmap@codeaurora.org, Saravana Kannan List-Id: linux-pm@vger.kernel.org Hi Rafael, On Tuesday 11 Dec 2018 at 13:01:24 (+0100), Rafael J. Wysocki wrote: > On Mon, Dec 3, 2018 at 10:56 AM Quentin Perret wrote: > > [cut] > > > #ifdef CONFIG_CPU_FREQ_GOV_SCHEDUTIL > > +/** > > + * enum schedutil_type - CPU utilization type > > + * @FREQUENCY_UTIL: Utilization used to select frequency > > + * @ENERGY_UTIL: Utilization used during energy calculation > > + * > > + * The utilization signals of all scheduling classes (CFS/RT/DL) and IRQ time > > + * need to be aggregated differently depending on the usage made of them. This > > + * enum is used within schedutil_freq_util() to differentiate the types of > > + * utilization expected by the callers, and adjust the aggregation accordingly. > > + */ > > +enum schedutil_type { > > + FREQUENCY_UTIL, > > + ENERGY_UTIL, > > +}; > > Why not to use bool instead of this? Do you expect to have more than > just two values in the future? If so, what would be the third one? Indeed, the only reason is that an enum is easier to extend, if need be. I think you mentioned some time ago that CPUIdle could be, in principle, interested in having access to aggregated utilization signals of CPUs: https://lore.kernel.org/lkml/CAJZ5v0j=EYnANGAj9bd44eeux1eCfeMtdn9npe5pSAzE8EVKaA@mail.gmail.com/ So yeah, I kept Peter's original enum and went for documenting the type, as you suggested on v7 :-) Thanks, Quentin