Re: çå: [PATCH V4] sched/cpufreq: initialize iowait_boost_max and iowait_boost with cpu capacity

From: Quentin Perret
Date: Mon Mar 04 2019 - 08:58:17 EST

On Monday 04 Mar 2019 at 07:35:04 (+0000), Wang, Vincent (çä) wrote:
> Did you mean the value of arch_scale_cpu_capacity() is changed in
> cpu_capacity_store()?

Yes, there's that, but more importantly topology_normalize_cpu_scale()
is called during boot. With printks() in the relevant functions, the
boot log on my system with two CPUFreq policies looks like this:

[ 2.393085] init_cpu_capacity_callback: policy0
[ 2.397714] sugov_start: policy0
[ 2.403734] init_cpu_capacity_callback: policy1
[ 2.407901] topology_normalize_cpu_scale: done
[ 2.412581] sugov_start: policy1

So, the lack of order of sugov_start() and topology_normalize_cpu_scale()
is a problem, I think.

> If so, I can restart schedutil governor after new capacity is updated.

Hmm, that feels a bit overkill, but that should at least be a correct
way of updating sg_cpu->{min, max} in a non-racy way. And CPU capacity
changes are infrequent, so the overhead of re-starting the governor
isn't a major issue, I suppose.

You could also update the values in sugov_get_util() at the cost of a
small overhead to compute 'min'. I'm not sure what's preferable since
we wanted to avoid that kind of overhead in the first place ...