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:24:24 +0000 Message-ID: <20181211122422.x4xt3kde54wqncvw@queper01-lin> References: <20181203095628.11858-1-quentin.perret@arm.com> <20181203095628.11858-3-quentin.perret@arm.com> <20181211121742.d6ujfyccwn7t63b3@queper01-lin> 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 On Tuesday 11 Dec 2018 at 13:22:41 (+0100), Rafael J. Wysocki wrote: > On Tue, Dec 11, 2018 at 1:17 PM Quentin Perret wrote: > > > > 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 :-) > > OK, so please feel free to add > > Acked-by: Rafael J. Wysocki > > to this patch. Thanks ! Quentin