LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: John <linux.kernel@free.fr>
Cc: linux-kernel@vger.kernel.org, johnstul@us.ibm.com, mingo@elte.hu,
zippel@linux-m68k.org, tglx@timesys.com,
akpm@linux-foundation.org, jbohac@suse.cz
Subject: Re: CLOCK_MONOTONIC datagram timestamps by the kernel
Date: Mon, 26 Feb 2007 13:20:57 +0100 [thread overview]
Message-ID: <200702261320.57726.ak@suse.de> (raw)
In-Reply-To: <45E2B5E4.7020208@free.fr>
Mr Anonymous,
>
> My app expects a stream of UDP datagrams containing compressed video.
> These datagrams have been time stamped by the source using a high
> resolution clock.
Why do you need another time stamp them?
>
> The video stream is played out in real-time. I buffer several packets,
> then repeatedly arm a one-shot timer (with TIMER_ABSTIME set) to wait
> until it's time to send the oldest packet.
>
> AFAIU, if I use the CLOCK_REALTIME clock in my app, and if the sysadmin
> changes the date, hell will break loose in my app.
Only if your app cannot handle time going backwards.
> I suppose that if I change sock_get_timestamp() in core/sock.c to call
> __get_realtime_clock_ts() instead of do_gettimeofday() I'll break 50
> billion applications (ping? traceroute?) that expect a struct timeval?
Not that many, but some probably.
Letting the kernel do the time stamping is usually quite useless anyways.
You can as well do it in your application when you receive it. After all
you're interested in when you can read the packet in your app,
not when the driver processes it.
The kernel time stamping is mainly for sniffing applications that want
to know exactly what's going on on the wire. But even then it's fairly
arbitary because it can be a long time between the packet arriving
on the PHY and being processed by the driver.
-Andi
next prev parent reply other threads:[~2007-02-26 12:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-25 21:29 John
2007-02-26 10:26 ` John
2007-02-26 12:20 ` Andi Kleen [this message]
2007-02-26 14:17 ` John
2007-02-28 11:23 ` John
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=200702261320.57726.ak@suse.de \
--to=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=jbohac@suse.cz \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux.kernel@free.fr \
--cc=mingo@elte.hu \
--cc=tglx@timesys.com \
--cc=zippel@linux-m68k.org \
--subject='Re: CLOCK_MONOTONIC datagram timestamps by the kernel' \
/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
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).