public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Shailabh Nagar <nagar@watson.ibm.com>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: [Patch 1/4] Delay accounting: Initialization
Date: Tue, 15 Nov 2005 10:34:30 -0200	[thread overview]
Message-ID: <20051115123430.GC32373@logos.cnet> (raw)
In-Reply-To: <20051115122035.GB32373@logos.cnet>

On Tue, Nov 15, 2005 at 10:20:35AM -0200, Marcelo Tosatti wrote:
> On Tue, Nov 15, 2005 at 10:19:17AM -0500, Shailabh Nagar wrote:
> > Marcelo Tosatti wrote:
> > > On Mon, Nov 14, 2005 at 08:20:17PM -0800, Andrew Morton wrote:
> > > 
> > >>Shailabh Nagar <nagar@watson.ibm.com> wrote:
> > >>
> > >>>+	*ts = sched_clock();
> > >>
> > >>I'm not sure that it's kosher to use sched_clock() for fine-grained
> > >>timestamping like this.  Ingo had issues with it last time this happened?  
> 
> Maybe Ingo had some other issue other than !use_rtc ? Better check.
> 
> > > If the system boots with use_rtc == 0 you're going to get jiffies based
> > > resolution from sched_clock(). I have a 1GHz Pentium 3 around here which
> > > does that.
> > 
> > Good point, thanks. This reemphasizes the need for better normalization
> > at output time.
> 
> > > Maybe use do_gettimeofday() for such systems?
> > 
> > Perhaps getnstimeofday() so resolution isn't reduced to msec level unnecessarily.
Yep.
> > In these patches, userspace takes responsibility for handling wraparound so
> > delivering a reasonably high-resolution delay data from the kernel is preferable.
> > 
> > > 
> > > Would be nice to have a sort of per-arch overridable "gettime()" function?
> > > 
> > 
> > Provided as part of this patch ?
> 
> Yep, think so. 

Actually I dont think there is any kind of "get_timestamp()" style 
API now. Maybe it would be nice to create one? Its generic functionality 
after all.

blktrace is also using sched_clock(), too.


> My comment meant that its nice to hide away architecture 
> speficic code from generic code, so you don't have to add #ifdef's and 
> such.
> 
> Not sure about the nicer way to do that.
> 
> -
> 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/

  reply	other threads:[~2005-11-15 17:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-15  4:35 [Patch 1/4] Delay accounting: Initialization Shailabh Nagar
2005-11-15  4:20 ` Andrew Morton
2005-11-15  6:49   ` Marcelo Tosatti
2005-11-15 15:19     ` Shailabh Nagar
2005-11-15 12:20       ` Marcelo Tosatti
2005-11-15 12:34         ` Marcelo Tosatti [this message]
2005-11-15 15:08   ` Shailabh Nagar
2005-11-16  1:06   ` Peter Chubb
2005-11-16  1:48     ` Shailabh Nagar
2005-11-16  1:50       ` Andi Kleen
2005-11-16  1:52       ` Peter Chubb
2005-11-15  4:25 ` Parag Warudkar
2005-11-15 22:29   ` Shailabh Nagar
2005-11-15 22:53     ` Parag Warudkar
2005-11-16  0:45       ` Shailabh Nagar
2005-11-16  2:41         ` Parag Warudkar

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=20051115123430.GC32373@logos.cnet \
    --to=marcelo.tosatti@cyclades.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nagar@watson.ibm.com \
    /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