public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Balbir Singh <balbir@in.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, lse-tech@lists.sourceforge.net,
	jlan@engr.sgi.com
Subject: Re: [Patch 3/8] cpu delay collection via schedstats
Date: Tue, 9 May 2006 09:30:50 +0530	[thread overview]
Message-ID: <20060509040050.GE784@in.ibm.com> (raw)
In-Reply-To: <20060508142640.675665c7.akpm@osdl.org>

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

  reply	other threads:[~2006-05-09  4:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-02  6:15 [Patch 3/8] cpu delay collection via schedstats Balbir Singh
2006-05-08 21:26 ` Andrew Morton
2006-05-09  4:00   ` Balbir Singh [this message]
2006-05-10 10:24   ` [PATCH][delayacct] Use better names in schedstats (was Re: [Patch 3/8] cpu delay collection via schedstats) Balbir Singh
  -- strict thread matches above, loose matches on Subject: below --
2006-04-22  2:16 [Patch 0/8] per-task delay accounting Shailabh Nagar
2006-04-22  2:33 ` [Patch 3/8] cpu delay collection via schedstats Shailabh Nagar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060509040050.GE784@in.ibm.com \
    --to=balbir@in.ibm.com \
    --cc=akpm@osdl.org \
    --cc=jlan@engr.sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lse-tech@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox