netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: Krishna Kumar2 <krkumar2@in.ibm.com>
Cc: David Miller <davem@davemloft.net>,
	Gagan Arneja <gaagaan@gmail.com>, Jeff Garzik <jeff@garzik.org>,
	Evgeniy Polyakov <johnpol@2ka.mipt.ru>,
	Matt Carlson <mcarlson@broadcom.com>,
	Michael Chan <mchan@broadcom.com>,
	netdev <netdev@vger.kernel.org>, Rick Jones <rick.jones2@hp.com>,
	Robert Olsson <Robert.Olsson@data.slu.se>,
	Sridhar Samudrala <sri@us.ibm.com>
Subject: Re: [WIP][PATCHES] Network xmit batching - tg3 support
Date: Wed, 04 Jul 2007 09:22:39 -0400	[thread overview]
Message-ID: <1183555359.5157.38.camel@localhost> (raw)
In-Reply-To: <OF95AE6EF1.D13A78A8-ON6525730E.0016D384-6525730E.0017C2E4@in.ibm.com>

On Wed, 2007-04-07 at 09:49 +0530, Krishna Kumar2 wrote:

> Do you see any contention for tx_lock which can justify having a prep
> handler? As I understood, no other CPU can be in the xmit code at the
> same time since RUNNING bit is held. Hence getting this lock early or
> late should not matter for the xmit side (and you are also holding
> dev->queue_lock while running prep so no new skbs can also be added to
> the dev during this time). And I couldn't find any driver that uses the
> same tx_lock on rx, 

On any non-LLTX driver:
netif_tx_lock() is grabbed on both tx and receive paths. 

I have to admit, the e1000 is too clever for its own good:
there is no documentation/description (and Herbert never explained) but
it seems to be able to play with only certain parts of the ring on tx
side and others on rx side so that a lock becomes unnecessary. So even
for non-LLTX, some lock needs to be held on rx just to be clean (and
theres a lot of grunty-ness against LLTX drivers out there).

> so where is the saving by doing prep ?

You would agree i think that if there is contention between two CPUs for
the same lock, gut feeling is there is benefit to do things outside the
lock when possible. This becomes more important with batching when
amortizing the cost of a lock.
Theres a little more than that and I could write up a longer description
if needed.

Also note: not all drivers may be able to move things outside of the
lock - infact the tun driver i converted is hard to do anything with
since it doesnt have any hardware features that makes it easy to move
things outside. For this reason this api is optional (and tun infact
doesnt use it); and as i have said a few times now, i will be more than
happy to get rid of it if experiments show it is unnecessary. For now my
take is someone needs to disprove it is valuable (most prefered with
experiments).

cheers,
jamal


  reply	other threads:[~2007-07-04 13:22 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06 13:49 [WIP][PATCHES] Network xmit batching jamal
2007-06-07  6:16 ` Krishna Kumar2
2007-06-07 11:43   ` jamal
2007-06-07 16:13     ` Evgeniy Polyakov
2007-06-07 22:23       ` jamal
2007-06-08  8:38         ` Evgeniy Polyakov
2007-06-08 11:31           ` jamal
2007-06-08 12:09             ` Evgeniy Polyakov
2007-06-08 13:07               ` jamal
2007-06-08 21:02                 ` Evgeniy Polyakov
2007-06-08  5:05       ` Krishna Kumar2
2007-06-19 13:21     ` Evgeniy Polyakov
2007-06-19 13:33       ` Evgeniy Polyakov
2007-06-19 14:00         ` Evgeniy Polyakov
2007-06-19 14:09           ` Evgeniy Polyakov
2007-06-19 16:32             ` jamal
2007-06-19 16:44               ` Evgeniy Polyakov
2007-06-19 16:28           ` jamal
2007-06-19 16:35             ` Evgeniy Polyakov
2007-06-19 16:45             ` Evgeniy Polyakov
2007-06-19 17:35             ` Robert Olsson
2007-06-19 17:48               ` jamal
2007-06-19 17:55                 ` Evgeniy Polyakov
2007-06-28  0:05                 ` [WIP][PATCHES] Network xmit batching - tg3 support jamal
2007-07-02 21:20                   ` Matt Carlson
2007-07-03  0:21                     ` Michael Chan
2007-07-03 13:26                       ` jamal
2007-07-04  4:19                         ` Krishna Kumar2
2007-07-04 13:22                           ` jamal [this message]
2007-07-03 13:09                     ` jamal
2007-07-03 19:31                       ` Matt Carlson
2007-07-04  1:59                         ` jamal
2007-07-03 21:30                       ` David Miller
2007-06-19 22:28               ` [WIP][PATCHES] Network xmit batching David Miller
2007-06-21 15:54                 ` FSCKED clock sources WAS(Re: " jamal
2007-06-21 16:08                   ` jamal
2007-06-21 16:55                     ` Benjamin LaHaise
2007-06-25 16:59                       ` jamal
2007-06-25 17:08                         ` Benjamin LaHaise
2007-06-25 17:16                           ` jamal
2007-06-21 16:45                   ` Evgeniy Polyakov
2007-06-25 16:58                     ` jamal
2007-06-19 16:24       ` jamal
2007-06-21 21:00       ` Rick Jones
2007-06-22  9:59         ` Evgeniy Polyakov
2007-06-25 17:35           ` Rick Jones
2007-06-07  8:42 ` Krishna Kumar2
2007-06-07 12:16   ` jamal
2007-06-08  5:06     ` Krishna Kumar2
2007-06-08 11:14       ` jamal
2007-06-08 11:31         ` Krishna Kumar2
2007-06-08 11:43           ` jamal
2007-06-08 18:00           ` Rick Jones
2007-06-08 17:27     ` Rick Jones
2007-06-09  0:17       ` jamal
2007-06-09  0:40         ` Rick Jones
2007-06-07 22:42 ` jamal

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=1183555359.5157.38.camel@localhost \
    --to=hadi@cyberus.ca \
    --cc=Robert.Olsson@data.slu.se \
    --cc=davem@davemloft.net \
    --cc=gaagaan@gmail.com \
    --cc=jeff@garzik.org \
    --cc=johnpol@2ka.mipt.ru \
    --cc=krkumar2@in.ibm.com \
    --cc=mcarlson@broadcom.com \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=rick.jones2@hp.com \
    --cc=sri@us.ibm.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).