Hi, On 23/05/17 21:04, Peter Zijlstra wrote: > On Tue, May 23, 2017 at 09:53:47AM +0100, Juri Lelli wrote: > > @@ -157,14 +158,13 @@ static unsigned int get_next_freq(struct sugov_policy > > *sg_policy, > > return cpufreq_driver_resolve_freq(policy, freq); > > } > > > > -static void sugov_get_util(unsigned long *util, unsigned long *max) > > +static void sugov_get_util(struct sugov_cpu *sg_cpu) > > { > > struct rq *rq = this_rq(); > > - unsigned long dl_util = (rq->dl.running_bw * SCHED_CAPACITY_SCALE) >> > > 20; > > > > - *max = arch_scale_cpu_capacity(NULL, smp_processor_id()); > > - > > - *util = min(rq->cfs.avg.util_avg + dl_util, *max); > > + sg_cpu->max = arch_scale_cpu_capacity(NULL, smp_processor_id()); > > + sg_cpu->util_cfs = rq->cfs.avg.util_avg; > > + sg_cpu->util_dl = (rq->dl.running_bw * SCHED_CAPACITY_SCALE) >> 20; > > } > > Luca just introduced a nice BW_SHIFT for that '20' thing.
Right, will use that. Thanks, - Juri