Re: [RFC PATCH 0/4] sched: Improve cpu load accounting with nohz

From: Peter Zijlstra
Date: Thu Jan 14 2016 - 16:27:25 EST


On Thu, Jan 14, 2016 at 09:19:00PM +0000, Dietmar Eggemann wrote:
> @@ -4346,7 +4346,10 @@ static void __update_cpu_load(struct rq *this_rq, unsigned long this_load,
>
> /* scale is effectively 1 << i now, and >> i divides by scale */
>
> - old_load = this_rq->cpu_load[i] - tickless_load;
> + if (this_rq->cpu_load[i] > tickless_load)
> + old_load = this_rq->cpu_load[i] - tickless_load;
> + else
> + old_load = 0;

Yeah, yuck. That'd go bad quick.