lkml.org 
[lkml]   [2006]   [May]   [9]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 9 May 2006 09:30:50 +0530
FromBalbir Singh <>
SubjectRe: [Patch 3/8] cpu delay collection via schedstats
On Mon, May 08, 2006 at 02:26:40PM -0700, Andrew Morton wrote:
> Balbir Singh <balbir@in.ibm.com> wrote:
> >
> > +/*
> > + * Expects runqueue lock to be held for atomicity of update
> > + */
> > +static inline void rq_sched_info_arrive(struct runqueue *rq,
> > +						unsigned long diff)
> > +{
> > +	if (rq) {
> > +		rq->rq_sched_info.run_delay += diff;
> > +		rq->rq_sched_info.pcnt++;
> > +	}
> > +}
> > +
> > +/*
> > + * Expects runqueue lock to be held for atomicity of update
> > + */
> > +static inline void rq_sched_info_depart(struct runqueue *rq,
> > +						unsigned long diff)
> > +{
> > +	if (rq)
> > +		rq->rq_sched_info.cpu_time += diff;
> > +}
> 
> The kernel has many different units of time - jiffies, cpu ticks, ns, us,
> ms, etc.  So the reader of these functions doesn't have a clue what "diff"
> is.
> 
> A good way to remove all doubt in all cases is to include the units in the
> variable's name.  Something like delta_jiffies, perhaps.

Yes, that makes sense and enhances readability. We will fix the naming
convention. "diff" is indeed "delta_jiffies"


	Thanks,
	Balbir Singh,
	Linux Technology Center,
	IBM Software Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-09 04:06    [from the cache]
©2003-2008