[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1329349028.2293.190.camel@twins>
Date: Thu, 16 Feb 2012 00:37:08 +0100
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: Paul Turner <pjt@...gle.com>
Cc: linux-kernel@...r.kernel.org, Venki Pallipadi <venki@...gle.com>,
Srivatsa Vaddagiri <vatsa@...ibm.com>,
Mike Galbraith <efault@....de>,
Kamalesh Babulal <kamalesh@...ux.vnet.ibm.com>,
Ben Segall <bsegall@...gle.com>, Ingo Molnar <mingo@...e.hu>,
Vaidyanathan Srinivasan <svaidy@...ux.vnet.ibm.com>
Subject: Re: [RFC PATCH 01/14] sched: track the runnable average on a
per-task entitiy basis
On Wed, 2012-02-01 at 17:38 -0800, Paul Turner wrote:
> + /*
> + * Use 1024us as the unit of measurement since it's a reasonable
> + * approximation of 1ms and fast to compute.
> + */
> + delta >>= 10;
ns -> us ?, text talks about ms, slightly confusing
> + if (!delta)
> + return 0;
> + sa->last_runnable_update = now;
> +
> + delta_w = sa->runnable_avg_period % 1024;
so delta_w is the chunk of this p we already accounted.
> + if (delta + delta_w >= 1024) {
if delta pushes us over 1024*1024 ns (~1ms) we roll a window.
> + /* period roll-over */
> + decayed = 1;
> +
> + delta_w = 1024 - delta_w;
The distance we need to reach the next window.
> + BUG_ON(delta_w > delta);
somehow reading this code took forever, this suggests clarification,
either through better variable names or more comments. Could also mean
I'm a moron and should get more sleep or so :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists