From: Mitchell Blank Jr <mitch@sfgoth.com>
To: "David S. Miller" <davem@redhat.com>
Cc: netdev@oss.sgi.com
Subject: Re: do_gettimeofday
Date: Fri, 3 Oct 2003 02:26:17 -0700 [thread overview]
Message-ID: <20031003092617.GI42593@gaz.sfgoth.com> (raw)
In-Reply-To: <20031003015220.7ee6e451.davem@redhat.com>
David S. Miller wrote:
> There is the weird issue (with both the sparc64 example and your's
> here) of whether we should care about what happens when settimeofday()
> occurs. We probably shouldn't worry about it... as it gives weird
> results even currently.
Nah. If anything you'll get better results since you're computing
the timeval later.
This is another argument for caching the computation though - otherwise
a settimeofday() could cause the packet timestamp to change drasically
from one observation to the next :-)
> > The worst case of
> > doing a cross-cpu-call should only happen relatively rarely.
>
> No, they typically won't. The packet comes in on cpu X, we stamp
> it on X, and we do a wakeup of tcpdump which will typically get
> scheduled first onto some other processor before X is done processing
> incoming packets. The higher the packet load the more likely this will
> happen.
I was more thinking about the other timestamp users. I don't consider
tcpdump something that needs as much optimization. If we really wanted
to we could have set a per-interface flag that says "someone will want
the timestamp so compute it in the bh while we're still on the same
processor" But see below - there probably isn't much cost anyways...
> This is mainly a product
> of how often you intend to update the tsc+timeval thingy.
You could compute it relatively frequently and then only actually
copy it to the hot cacheline if its diverged significantly from whats
there. This would make the writes almost never happen (maybe once a
minute)
-Mitch
next prev parent reply other threads:[~2003-10-03 9:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-02 18:32 do_gettimeofday Steve Modica
2003-10-02 19:29 ` do_gettimeofday Andi Kleen
2003-10-02 19:56 ` do_gettimeofday Stephen Hemminger
2003-10-02 20:46 ` do_gettimeofday Mitchell Blank Jr
2003-10-03 7:41 ` do_gettimeofday David S. Miller
2003-10-03 8:26 ` do_gettimeofday Mitchell Blank Jr
2003-10-03 8:27 ` do_gettimeofday David S. Miller
2003-10-03 8:48 ` do_gettimeofday Mitchell Blank Jr
2003-10-03 8:52 ` do_gettimeofday David S. Miller
2003-10-03 9:26 ` Mitchell Blank Jr [this message]
2003-10-03 9:23 ` do_gettimeofday David S. Miller
2003-10-03 16:42 ` do_gettimeofday Ben Greear
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=20031003092617.GI42593@gaz.sfgoth.com \
--to=mitch@sfgoth.com \
--cc=davem@redhat.com \
--cc=netdev@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).