Re: [PATCH v6 03/11] sched/rt: add rt_rq utilization tracking

From: Peter Zijlstra
Date: Thu Jun 21 2018 - 14:50:54 EST


On Fri, Jun 08, 2018 at 02:09:46PM +0200, Vincent Guittot wrote:
> +int update_rt_rq_load_avg(u64 now, struct rq *rq, int running)
> +{
> + if (___update_load_sum(now, rq->cpu, &rq->avg_rt,
> + running,
> + running,
> + running)) {

For code like this I wish C had grown named arguments for calls, just
like it has named initializers.

Something like:

___update_load_sum(now, rq->cpu, &rq->avg_rt,
.load = running, .runnable = running,
.running = running)

would be so much easier to read... a well, maybe in another 30 years or
so.

> + ___update_load_avg(&rq->avg_rt, 1, 1);
> + return 1;
> + }
> +
> + return 0;
> +}