[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180321145032.GD15165@localhost.localdomain>
Date: Wed, 21 Mar 2018 15:50:32 +0100
From: Juri Lelli <juri.lelli@...il.com>
To: Quentin Perret <quentin.perret@....com>
Cc: Patrick Bellasi <patrick.bellasi@....com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Thara Gopinath <thara.gopinath@...aro.org>,
linux-pm@...r.kernel.org,
Morten Rasmussen <morten.rasmussen@....com>,
Chris Redpath <chris.redpath@....com>,
Valentin Schneider <valentin.schneider@....com>,
"Rafael J . Wysocki" <rjw@...ysocki.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Viresh Kumar <viresh.kumar@...aro.org>,
Todd Kjos <tkjos@...gle.com>,
Joel Fernandes <joelaf@...gle.com>
Subject: Re: [RFC PATCH 4/6] sched/fair: Introduce an energy estimation
helper function
On 21/03/18 14:26, Quentin Perret wrote:
> On Wednesday 21 Mar 2018 at 12:39:21 (+0000), Patrick Bellasi wrote:
> > On 20-Mar 09:43, Dietmar Eggemann wrote:
[...]
> >
> > If that's the case then, in the previous function, you can certainly
> > avoid the initialization of *cs and maybe also add an explicit:
> >
> > BUG_ON(em->nb_cap_states == 0);
> >
> > which helps even just as "in code documentation".
> >
> > But, I'm not sure if maintainers like BUG_ON in scheduler code :)
>
> Yes, I'm not sure about the BUG_ON either :). I agree that it would be
> nice to document somewhere that compute_energy() is unsafe to call
> without sched_energy_present. I can simply add a proper doc comment to
> this function actually. Would that work ?
If it is something that must not happen and it is also non recoverable
at runtime, then...
$ git grep BUG_ON -- kernel/sched/ | wc -l
50
:)
Powered by blists - more mailing lists