linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Benjamin Herrenschmidt <benh@ozlabs.org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>,
	Ingo Molnar <mingo@elte.hu>, Arnd Bergmann <arndb@de.ibm.com>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: cpu_clock confusion (was: printk time confusion?)
Date: Thu, 03 Apr 2008 18:34:10 +0200	[thread overview]
Message-ID: <1207240450.3797.22.camel@johannes.berg> (raw)
In-Reply-To: <1207219724.10388.319.camel@pasglop>

[-- Attachment #1: Type: text/plain, Size: 1506 bytes --]

Hi,

> > Not sure whether the lockdep patches or something else is causing this
> > as I haven't checked w/o the patches yet, but I seem to be having some
> > confusion of printk timestamps:
> 
> Tried reverting the patches ?

That didn't help, so it's not the lockdep patches causing it. I'm still
seeing printk timestamps like this:

[    2.764009 (3/3)]
[    4.272241 (2/2)]
[    4.272322 (2/2)]
[    4.272375 (2/2)]
[    2.948002 (3/3)]

As you can see, I added printk_cpu and smp_processor_id() to the printk
timestamp output and thus it is obvious that the different times come
from different CPUs.

I have to admit that I do not understand the cpu_clock() implementation,
but I can only point out that the bug seems to be there since our
sched_clock() uses the timebase which is certainly synchronized. For the
fun of it, here's another output, with get_tb() thrown in:

[   15.285317 (0/0,1734086151)]
[   13.563845 (3/3,1757040324)]
[   13.700157 (3/3,1773150788)]
[   15.181275 (1/1,1829646200)]
[   15.181343 (1/1,1829648488)]
[   16.987944 (0/0,1829664311)]
[   16.988485 (0/0,1829682407)]
[   12.047482 (2/2,1829690681)]

As expected, the timebase is perfectly fine, it's monotonously
increasing over all the processors, but cpu_clock() doesn't seem to
notice. Not sure what to make of it. It seems just using the timebase
(in form of sched_clock()) ought to be perfectly fine and even have less
overhead than all this cpu_clock() business.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  parent reply	other threads:[~2008-04-03 16:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-02 14:23 printk time confusion? Johannes Berg
2008-04-03 10:48 ` Benjamin Herrenschmidt
2008-04-03 11:07   ` Johannes Berg
2008-04-03 11:08   ` Andreas Schwab
2008-04-03 11:12     ` Johannes Berg
2008-04-03 11:24       ` Andreas Schwab
2008-04-03 16:34   ` Johannes Berg [this message]
2008-04-04 14:46     ` cpu_clock confusion (was: printk time confusion?) Ingo Molnar
2008-04-24  9:21       ` Johannes Berg
2008-04-24  9:24         ` cpu_clock confusion David Miller
2008-04-24  9:27           ` Johannes Berg
2008-04-28  8:46             ` Gabriel Paubert

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=1207240450.3797.22.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=arndb@de.ibm.com \
    --cc=benh@ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mingo@elte.hu \
    /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;
as well as URLs for NNTP newsgroup(s).