public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Balbir Singh <balbir@in.ibm.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, lse-tech@lists.sourceforge.net,
	jlan@engr.sgi.com, Andrew Morton <akpm@osdl.org>
Subject: Re: [Lse-tech] Re: [Patch 1/8] Setup
Date: Tue, 9 May 2006 18:50:36 +0530	[thread overview]
Message-ID: <20060509132036.GA7722@in.ibm.com> (raw)
In-Reply-To: <1147175206.7392.39.camel@localhost.localdomain>

On Tue, May 09, 2006 at 11:46:46AM +0000, Thomas Gleixner wrote:
> On Tue, 2006-05-02 at 11:42 +0530, Balbir Singh wrote:
> >  /*
> > + * sub = end - start, in normalized form
> > + */
> > +static inline void timespec_sub(struct timespec *start, struct timespec *end,
> > +				struct timespec *sub)
> > +{
> > +	set_normalized_timespec(sub, end->tv_sec - start->tv_sec,
> > +				end->tv_nsec - start->tv_nsec);
> > +}
> 
> Please use the existing ktime_t functions for that purpose. The ktime_t
> format has nanosecond resolution and is optimized for 32/64bit machines.
> 
> > +static inline void delayacct_start(struct timespec *start)
> > +{
> > +	do_posix_clock_monotonic_gettime(start);
> > +}
> 
> Please get rid of this wrapper and use the ktime based functions for
> that.
> 
> > +/*
> > + * Finish delay accounting for a statistic using
> > + * its timestamps (@start, @end), accumalator (@total) and @count
> > + */
> > +
> > +static inline void delayacct_end(struct timespec *start, struct timespec *end,
> > +				u64 *total, u32 *count)
> 
> Please use ktime_t for total.
> 			
> > +{
> > +	struct timespec ts = {0, 0};
> > +	s64 ns;
> > +
> > +	do_posix_clock_monotonic_gettime(end);
> > +	timespec_sub(&ts, start, end);
> > +	ns = timespec_to_ns(&ts);
> > +	if (ns < 0)
> > +		return;
> 
> monotonic time is monotonic increasing. So delta is always >= 0 !
> 
> 	tglx
> 
> 
> 
>

I am going through the ktime interface and it seems interesting.
I will look into it and see if we can migrate the interface
to use ktime
 

	Balbir Singh,
	Linux Technology Center,
	IBM Software Labs

      reply	other threads:[~2006-05-09 13:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-02  6:12 [Patch 1/8] Setup Balbir Singh
2006-05-08 21:17 ` Andrew Morton
2006-05-09  3:48   ` Balbir Singh
2006-05-10 10:16   ` [PATCH][delayacct] Fix the timespec_sub() interface (was Re: [Patch 1/8] Setup) Balbir Singh
2006-05-10 10:24     ` Andrew Morton
2006-05-10 10:27       ` Balbir Singh
2006-05-10 10:58         ` Balbir Singh
2006-05-08 21:23 ` [Patch 1/8] Setup Andrew Morton
2006-05-09  3:56   ` Balbir Singh
2006-05-10 10:18   ` [PATCH][delayacct] un-inline delayacct_end(), remove initialization of ts (was Re: [Patch 1/8] Setup) Balbir Singh
2006-05-09 11:46 ` [Patch 1/8] Setup Thomas Gleixner
2006-05-09 13:20   ` Balbir Singh [this message]

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=20060509132036.GA7722@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 \
    --cc=tglx@linutronix.de \
    /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