netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Modica <modica@sgi.com>
To: netdev@oss.sgi.com
Subject: do_gettimeofday
Date: Thu, 02 Oct 2003 13:32:27 -0500	[thread overview]
Message-ID: <3F7C6F3B.6070502@sgi.com> (raw)

We've been doing some experiments here with large numbers of adapters on a 64p Linux system. 

When running 8 threads and 8 cpus, the do_gettimeofday code starts to use a lot of time.

It turns out that if a driver does not timestamp an incoming packet, the upper layer will stamp it for you in
PSCHED_GET_TIME(stamp).  What happens then is multiple cpus start fighting over the cacheline for the system clock and things get bad. 

One possible solution to this is to have the driver do the stamp using xtime. A number of ATM drivers do this now. In testing, it helps a lot.

Here's a sample diff for the tg3.c driver:

===========================================================================
Index: linux/linux/drivers/net/tg3.c
===========================================================================
 
--- /usr/tmp/TmpDir.8948-0/linux/linux/drivers/net/tg3.c_1.23   Thu Oct  2 13:30:21 2003
+++ linux/linux/drivers/net/tg3.c       Wed Oct  1 14:27:54 2003
@@ -2019,6 +2019,7 @@
                        skb->ip_summed = CHECKSUM_NONE;
  
                skb->protocol = eth_type_trans(skb, tp->dev);
+               skb->stamp = xtime;
 #if TG3_VLAN_TAG_USED
                if (tp->vlgrp != NULL &&
                    desc->type_flags & RXD_FLAG_VLAN) {


It's been suggested that we make this tuneable so it's easy to enable and disable. There was concern as to whether xtime would be accurate enough for all possible uses of ->stamp.  

Does anyone have any comments on this?

Regards!
Steve





-- 
Steve Modica
work: 651-683-3224
mobile: 651-261-3201
MTS-Technical Lead
"Give a man a fish, and he will eat for a day, hit him with a fish and
he leaves you alone" - me

             reply	other threads:[~2003-10-02 18:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-02 18:32 Steve Modica [this message]
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             ` do_gettimeofday Mitchell Blank Jr
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=3F7C6F3B.6070502@sgi.com \
    --to=modica@sgi.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).