9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] a pair nec bugs
Date: Fri, 20 May 2011 15:16:02 -0400	[thread overview]
Message-ID: <9f7e3f9171e833cba1cd0e74fa56c8da@brasstown.quanstro.net> (raw)
In-Reply-To: <BANLkTim3p0FqDzey=gaBRDordN2BSB5j2A@mail.gmail.com>

On Fri May 20 15:04:48 EDT 2011, rminnich@gmail.com wrote:
> I did not read your post as carefully as I should, but I still have
> concerns when people use stuff like nsec() in the quest of accuracy.
> Sorry, I was sort of reacting to another thread in the Go list where
> somebody is using gettimeofday() and seems to think the nsec field has
> meaning :-)

no problems.  i've since realized there's a bug (which was probablly the
same bug that resulted in the really complicated current implementation)
that i've reintroduced.

the good news is the solution is to remove code.  :-)  i'll post a more
complete solution in a bit.

> We don't have good clocks.

i totally agree with this, but in x86 land, it's worth remembering
things have gotten much better since the bad old p4 days.  all
recent processors do have a stable tsc.

i'm doing a little something like you suggest in /dev/irqalloc.
fields 3 and 4 are number of calls and cumulative number of
cycles.  you can divide by cpumhz (in /dev/cputype) to get time
in ns.  the silly division is because ns just isn't good enough
resolution.  ether0 takes about 3.03ns/call.

; awk '$3>0' /dev/irqalloc
         50          18           7140587794       16282733189984 lapic    clock
         65           1               141628           1482204961 ioapic   kbd
         73          10            209046583        2149493918790 msi      ether0
         97          10                  896             64993576 ioapic   usbohci
         97          10                  896             64993576 ioapic   usbohci
         97          10                  896             64993576 ioapic   usbohci
         97          10                  896             64993576 ioapic   usbohci
         97          10                  896             64993576 ioapic   starport-pex2s.0C040000
        121          11                    9               239651 msi      sdE (ahci)
        129          12              1972430          20894050761 ioapic   kbdaux

- erik



  reply	other threads:[~2011-05-20 19:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-20  1:30 erik quanstrom
2011-05-20  5:05 ` [9fans] a pair nsec bugs erik quanstrom
2011-05-20 10:43 ` [9fans] a pair nec bugs ron minnich
2011-05-20 10:52   ` roger peppe
2011-05-20 10:57     ` ron minnich
2011-05-20 12:47   ` erik quanstrom
2011-05-20 19:03     ` ron minnich
2011-05-20 19:16       ` erik quanstrom [this message]
2011-05-21  3:27       ` erik quanstrom
2011-05-21  9:59         ` Charles Forsyth
2011-05-21 12:16           ` erik quanstrom
2011-05-21 21:50           ` erik quanstrom
2011-05-21 22:14             ` Charles Forsyth
2011-05-22  3:06               ` erik quanstrom
2011-05-22 13:30                 ` Charles Forsyth
2011-06-02 19:16                   ` erik quanstrom
2011-06-03  9:52                     ` Charles Forsyth
2011-06-04 18:12                       ` adriano
2011-06-03 13:13 erik quanstrom

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=9f7e3f9171e833cba1cd0e74fa56c8da@brasstown.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.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;
as well as URLs for NNTP newsgroup(s).