mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	stable@kernel.org, Greg KH <greg@kroah.com>,
	Chris Wright <chrisw@sous-sol.org>,
	Srivatsa Vaddagiri <vatsa@in.ibm.com>,
	Jan Glauber <jang@linux.vnet.ibm.com>, Andi Kleen <ak@suse.de>
Subject: Re: [patch] sched: implement cpu_clock(cpu) high-speed time source,   take #2
Date: Thu, 19 Jul 2007 20:20:07 +0200	[thread overview]
Message-ID: <20070719182007.GB11657@kernel.dk> (raw)
In-Reply-To: <469FA908.8090804@goop.org>

On Thu, Jul 19 2007, Jeremy Fitzhardinge wrote:
> Jens Axboe wrote:
> > On Thu, Jul 19 2007, Jeremy Fitzhardinge wrote:
> >   
> >>> Index: linux/block/blktrace.c
> >>> ===================================================================
> >>> --- linux.orig/block/blktrace.c
> >>> +++ linux/block/blktrace.c
> >>> @@ -41,7 +41,7 @@ static void trace_note(struct blk_trace 
> >>>  		const int cpu = smp_processor_id();
> >>>  
> >>>  		t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION;
> >>> -		t->time = sched_clock() - per_cpu(blk_trace_cpu_offset, cpu);
> >>> +		t->time = cpu_clock(cpu) - per_cpu(blk_trace_cpu_offset, cpu);
> >>>  		t->device = bt->dev;
> >>>  		t->action = action;
> >>>  		t->pid = pid;
> >>> @@ -159,7 +159,7 @@ void __blk_add_trace(struct blk_trace *b
> >>>  
> >>>  		t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION;
> >>>  		t->sequence = ++(*sequence);
> >>> -		t->time = sched_clock() - per_cpu(blk_trace_cpu_offset, cpu);
> >>> +		t->time = cpu_clock(cpu) - per_cpu(blk_trace_cpu_offset, cpu);
> >>>   
> >>>       
> >> What's this measuring here?  Time spend in IO?  Wouldn't it be better
> >> off with a measurement of real monotonic time?
> >>     
> >
> > It's not time spent in IO, it wants a nanosecond timestamp.
> >   
> 
> What kind of nanoseconds?  Real?  Virtual?
> 
> sched_clock() (and now cpu_clock()) measure the number of nanoseconds
> available for running CPU instructions (regardless of whether it chooses
> to use them or not), and so in a virtual environment doesn't include
> time stolen by the hypervisor for other VCPUs.

Real time, it's a timestamp that the user tools can use to see the time
delta between A and B.

So I guess blktrace currently doesn't work so well inside a gues...

-- 
Jens Axboe


  reply	other threads:[~2007-07-19 18:20 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-17 11:44 [patch] softlockup watchdog: fix Xen bogosity Ingo Molnar
2007-07-17 14:17 ` Jeremy Fitzhardinge
2007-07-17 15:49   ` [patch] fix the softlockup watchdog to actually work Ingo Molnar
2007-07-17 17:03     ` Randy Dunlap
2007-07-17 17:25       ` Ingo Molnar
2007-07-17 18:14       ` Linus Torvalds
2007-07-17 21:38         ` Randy Dunlap
2007-07-19  7:22     ` Andrew Morton
2007-07-19  7:46       ` Ingo Molnar
2007-07-19  7:51       ` Ingo Molnar
2007-07-19 14:31         ` Jeremy Fitzhardinge
2007-07-19 14:35           ` Ingo Molnar
2007-07-19 14:40             ` Jeremy Fitzhardinge
2007-07-19 14:46             ` Jeremy Fitzhardinge
2007-07-19 14:50               ` Ingo Molnar
2007-07-19 15:04                 ` Jeremy Fitzhardinge
2007-07-19 15:09                   ` Ingo Molnar
2007-07-19 15:21                     ` Jeremy Fitzhardinge
2007-07-19 15:42                       ` [patch] sched: implement cpu_clock(cpu) high-speed time source Ingo Molnar
2007-07-19 15:44                         ` [patch] sched: implement cpu_clock(cpu) high-speed time source, take #2 Ingo Molnar
2007-07-19 16:11                           ` Jeremy Fitzhardinge
2007-07-19 16:16                             ` Ingo Molnar
2007-07-19 16:18                               ` Jeremy Fitzhardinge
2007-07-19 16:21                                 ` Ingo Molnar
2007-07-19 16:29                                   ` Jeremy Fitzhardinge
2007-07-19 17:24                             ` Jens Axboe
2007-07-19 18:10                               ` Jeremy Fitzhardinge
2007-07-19 18:20                                 ` Jens Axboe [this message]
2007-07-25  8:49     ` [patch] fix the softlockup watchdog to actually work Andrew Morton
2007-07-25  8:52       ` Ingo Molnar
2007-07-25  8:55         ` Ingo Molnar
2007-07-25  9:00         ` Andrew Morton
2007-07-25  9:04           ` Ingo Molnar
2007-07-25  9:17             ` Andrew Morton
2007-07-25  9:23               ` Ingo Molnar
2007-07-25  9:59                 ` Jens Axboe
2007-07-25 11:04                   ` Ingo Molnar
2007-07-25 11:06                     ` Jens Axboe
2007-07-25 16:34       ` Andi Kleen
2007-10-03 23:49     ` Yinghai Lu

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=20070719182007.GB11657@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=chrisw@sous-sol.org \
    --cc=greg@kroah.com \
    --cc=jang@linux.vnet.ibm.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vatsa@in.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

Powered by JetHome