From: Andi Kleen <andi@firstfloor.org>
To: Joe Malicki <jmalicki@metacarta.com>
Cc: David Miller <davem@davemloft.net>,
andi@firstfloor.org, johnpol@2ka.mipt.ru, dada1@cosmosbay.com,
denys@visp.net.lb, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, juhlenko@akamai.com,
sammy@sammy.net
Subject: Re: loaded router, excessive getnstimeofday in oprofile
Date: Thu, 28 Aug 2008 09:22:18 +0200 [thread overview]
Message-ID: <20080828072218.GI26610@one.firstfloor.org> (raw)
In-Reply-To: <21915755.1327801219904892242.JavaMail.root@ouachita>
> I've worked with systems where SO_TIMESTAMP has been used for
> H.323 videoconferencing systems to synchronize audio and video
But didn't you really want a "end2end" time stamp in this case,
as in really at the end of all kernel/hardware queues on your side.
A packet roughly travels this way on a normal NIC before it hits recvmsg()
wire -> NIC on die buffers -> NIC RX ring -> interrupt handler ->
NAPI or per CPU queue -> softirq socket lookup -> socket queue -> recvmsg
These all do their own queuing and all queues can add delays depending
on the load. Right now SO_TIMESTAMP is in the interrupt handler,
but it's just an arbitary position in a multitude of queues.
For video conferencing (or e.g. in general if you implement a retransmit
timeout in user space) scheduling delays on the local box
surely need to be taken into account too because they all add
to the final timing of the packets on the wire.
The queues inside the system are really part of the network
too. In Linux for example the algorithms who size the TCP
buffer space know that and especially take account for it
and reserve a local queue buffer.
> where remote systems' timestamps on the protocol streams proved
> to be inaccurate (based off of different, unsynchronized clocks).
Yes, but why ignore local scheduling delays?
>
> I can't see any other realistic use of this, but trying to get
> timestamps for quasi-realtime protocols may be an important use
> case - and in that case, you want the time when it hits the
> interface, NOT when it hits the socket.
I think it's the other way round. Why would the real time
protocol care when it hits some arbitary queue in the network
stack instead of the time when the application can really
read the data?
> What utility does the time of hitting the socket get you?
SO_TIMESTAMP was originally invented for passive network
monitoring as in tcpdump (for which PACKET sockets were designed
originally, DHCP is really just abusing them imho). There it makes
some sense to do the time stamp as near on the wire as possible
but really a hardware time stamp would be better because
it is even nearer. But for anything that does end2end it's
the wrong semantics anyways because ignoring local queueing
delays would be just a bug, and SO_TIMESTAMP ignores them currently.
-Andi
--
ak@linux.intel.com
next prev parent reply other threads:[~2008-08-28 7:19 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-22 1:57 loaded router, excessive getnstimeofday in oprofile Denys Fedoryshchenko
2008-08-22 2:23 ` Denys Fedoryshchenko
2008-08-26 9:51 ` Jarek Poplawski
2008-08-26 10:29 ` Denys Fedoryshchenko
2008-08-26 10:47 ` Jarek Poplawski
2008-08-26 10:49 ` Denys Fedoryshchenko
2008-08-26 11:07 ` Jarek Poplawski
2008-08-26 11:15 ` Jarek Poplawski
2008-08-26 11:16 ` Denys Fedoryshchenko
2008-08-26 11:32 ` Jarek Poplawski
2008-08-26 11:32 ` Denys Fedoryshchenko
2008-08-26 20:14 ` Evgeniy Polyakov
2008-08-26 20:44 ` Eric Dumazet
2008-08-26 20:51 ` Evgeniy Polyakov
2008-08-27 12:09 ` Denys Fedoryshchenko
2008-08-27 12:36 ` Evgeniy Polyakov
2008-08-27 14:00 ` Denys Fedoryshchenko
2008-08-27 14:23 ` Evgeniy Polyakov
2008-08-27 12:54 ` Andi Kleen
2008-08-27 16:07 ` Rick Jones
2008-08-27 16:27 ` Andi Kleen
2008-08-27 16:49 ` Rick Jones
2008-08-27 16:56 ` Andi Kleen
2008-08-27 16:57 ` Rick Jones
2008-08-27 17:27 ` Eric Dumazet
2008-08-27 18:32 ` loaded router, excessive getnstimeofday in oprofile\ Andi Kleen
2008-08-27 22:23 ` David Miller
2008-08-27 22:38 ` Andi Kleen
2008-08-27 22:18 ` loaded router, excessive getnstimeofday in oprofile David Miller
2008-08-27 22:39 ` Andi Kleen
2008-08-28 0:45 ` Nick Piggin
2008-08-28 0:48 ` David Miller
2008-08-28 1:07 ` Nick Piggin
2008-08-27 16:17 ` Stephen Hemminger
2008-08-27 17:14 ` Jarek Poplawski
2008-08-27 21:34 ` David Miller
2008-08-28 2:39 ` Jason Uhlenkott
2008-08-28 3:10 ` David Miller
2008-08-28 6:28 ` Joe Malicki
2008-08-28 7:22 ` Andi Kleen [this message]
2008-08-28 15:02 ` Denys Fedoryshchenko
2008-08-28 19:01 ` Ilpo Järvinen
2008-08-28 19:31 ` David Miller
2008-08-28 16:48 ` Denys Fedoryshchenko
2008-08-28 16:56 ` Andi Kleen
2008-08-28 18:57 ` Eric Dumazet
2008-08-28 19:25 ` Denys Fedoryshchenko
2008-08-28 19:37 ` Eric Dumazet
2008-08-28 19:55 ` Denys Fedoryshchenko
2008-08-29 15:43 ` Stephen Hemminger
2008-08-28 19:36 ` David Miller
2008-08-28 19:59 ` Denys Fedoryshchenko
2008-08-29 15:21 ` Joe Malicki
2008-08-29 15:30 ` Andi Kleen
2008-08-29 15:43 ` Joe Malicki
2008-08-29 20:43 ` Evgeniy Polyakov
2008-08-28 18:00 ` Rick Jones
2008-08-28 19:42 ` David Miller
2008-08-28 20:29 ` Rick Jones
2008-08-28 20:32 ` David Miller
2008-08-28 20:45 ` Rick Jones
2008-08-28 20:47 ` David Miller
2008-09-01 2:39 ` Valdis.Kletnieks
2008-09-01 3:51 ` David Miller
2008-09-01 4:08 ` Valdis.Kletnieks
2008-09-01 4:10 ` David Miller
2008-09-02 17:04 ` Rick Jones
2008-08-28 3:35 ` Stephen Hemminger
2008-08-28 8:49 ` Denys Fedoryshchenko
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=20080828072218.GI26610@one.firstfloor.org \
--to=andi@firstfloor.org \
--cc=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=denys@visp.net.lb \
--cc=jmalicki@metacarta.com \
--cc=johnpol@2ka.mipt.ru \
--cc=juhlenko@akamai.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sammy@sammy.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