From: "Kok, Auke" <auke-jan.h.kok@intel.com>
To: Todd Tomaino <ttomaino@rivulet.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
NetDev <netdev@vger.kernel.org>
Subject: Re: E1000: e1000_update_stats()
Date: Wed, 05 Mar 2008 13:34:44 -0800 [thread overview]
Message-ID: <47CF11F4.6030207@intel.com> (raw)
In-Reply-To: <67F3071335CB9945A6047FE06957E0240D6D94CE93@exchange.rivulet.com>
[ Adding netdev@vger.kernel.org !]
Todd Tomaino wrote:
>
> I have been having trouble with interrupt latencies. While profiling my system, I measured the e1000_update_stats() function disabling interrupts for roughly 100 usec. For my application, this long of a delay results in data loss. The e1000_update_stats() function is broken down into 3 main operations:
>
> 1. acquire spinlock
> 2. read registers & update adapter->stat counters
> 3. update OS adapter->net_stats statistics
> 4. update phy stats.
> 5. release spinlock.
>
> On my system I measured 57 usec to perform operations #2 and #3, and 52 usec to perform operation #4.
>
> Reading the comments in the code it appeared that updating adapter->net_stats and adapter->stat required interrupts to be turned off to prevent the e1000_adjust_tbi_stats() function from modifying these structures from interrupt context. In order to reduce the amount of time spent with interrupts disabled I separated the register reads from updating adapter->stat counters. The register reads take up the bulk of the 57 usec and shouldn't require protection (I could be wrong). The new operation looks like this and reduces the amount of time spent with interrupts turned off by 1/2:
>
> 1. read registers
> 2. acquire spinlock
> 3. update adapter->stat counters
> 4. update OS adapter->net_stats statistics
> 5. update phy stats.
> 6. release spinlock.
>
>
> It seemed like a bad idea to attempt to move the phy reads out of the spin locked code area.
>
> These changes have greatly reduced my interrupt latency, but are there any negative side effects that could be caused??
not per se, I think you did the right thing here. I think it might even be safe to
move the PHY reads outside the spinlock area, and this is certainly something I
would like to try.
would you care to send an RFC patch to netdev@vger.kernel.org?
Also, I notice you are using an old driver/kernel. care to retest against the
latest git trees?
I'll certainly take your suggestion and have it tested.
Auke
parent reply other threads:[~2008-03-05 21:39 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <67F3071335CB9945A6047FE06957E0240D6D94CE93@exchange.rivulet.com>]
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=47CF11F4.6030207@intel.com \
--to=auke-jan.h.kok@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ttomaino@rivulet.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).