  `On Thu, Feb 13, 2020 at 05:49:48PM +0000, Douglas Raillard wrote:> > So even when:> > > >   boost = util_avg - util_est> > > > is small, despite util_avg being huge (~1024), due to large util_est,> > we'll still get an effective boost to max_cost ASSUMING cs[].cost and> > cost_margin have the same curve.> > I'm not sure to follow, cs[].cost can be plotted against cs[].freq, but> cost_margin is a time-based signal (the boost value), so it would be> plotted against time.Suppose we have the normalized energy vs frequency curve: x^3( P ~ V^2 * f, due to lack of better: V ~ f -> P ~ f^3 )  1 +--------------------------------------------------------------------+    |             +             +            +             +            *|    |                                                       x**3 ******* |    |                                                                **  |0.8 |-+                                                            **  +-|    |                                                             **     |    |                                                            *       |    |                                                          **        |0.6 |-+                                                       **       +-|    |                                                       **           |    |                                                     **             |    |                                                   ***              |0.4 |-+                                               ***              +-|    |                                               **                   |    |                                            ***                     |    |                                          ***                       |0.2 |-+                                    ****                        +-|    |                                  ****                              |    |                            ******                                  |    |             +     **********           +             +             |  0 +--------------------------------------------------------------------+    0            0.2           0.4          0.6           0.8            1where x is our normalized frequency and y is the normalized energy.Further, remember that schedutil does (per construction; for lack ofbetter):  f ~ uSo at u=0.6, we're at f=0.6 and P=0.2+               boost = util_avg - util_est_enqueued;So for util_est = 0.6, we're limited to: boost = 0.4.+       max_cost = pd->table[pd->nr_cap_states - 1].cost;+       cost_margin = (cost_margin * max_cost) / EM_COST_MARGIN_SCALE;Which then gives:  cost_margin = boost = 0.4And we find that:  P' = P + cost_margin = 0.2 + 0.4 = 0.6 < 1So even though set out to allow a 100% boost in energy usage, we were infact incapable of achieving this, because our cost_margin is linear in uwhile the energy (or cost) curve is cubic in u.That was my argument; but I think that now that I've expanded on it, Isee a flaw, because when we do have boost = 0.4, this means util_avg =1, and we would've selected f = 1, and boosting would've been pointless.So let me try again:  f = util_avg, P = f^3, boost = util_avg - util_est  P' = util_avg ^ 3 + util_avg - util_estAnd I'm then failing to make further sense of that; it of course meansthat P'(u) is larger than P(2u) for some u, but I don't think we setthat as a goal either.Let me ponder this a little more while I go read the rest of your email.`   