netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: alexander.h.duyck@intel.com
Cc: bhutchings@solarflare.com, jeffrey.t.kirsher@intel.com,
	netdev@vger.kernel.org, gospo@redhat.com
Subject: Re: [net-next 03/10] ixgbe: Drop the TX work limit and instead just leave it to budget
Date: Mon, 22 Aug 2011 16:40:27 -0700 (PDT)	[thread overview]
Message-ID: <20110822.164027.1830363266993513959.davem@davemloft.net> (raw)
In-Reply-To: <4E52DEEF.40504@intel.com>

From: Alexander Duyck <alexander.h.duyck@intel.com>
Date: Mon, 22 Aug 2011 15:57:51 -0700

> The problem was occurring even without large rings.
> I was seeing issues with rings just 256 descriptors in size.

And the default in the ixgbe driver is 512 entries which I think
itself is quite excessive.  Something like 128 is more in line with
what I'd call a sane default.

So the only side effect of your change is to decrease the TX quota to
64 (the default NAPI quota) from it's current value of 512
(IXGBE_DEFAULT_TXD).

Talking about the existing code, I can't even see how the current
driver private TX quota can trigger except in the most extreme cases.
This is because the quota is set the same as the size you're setting
the TX ring to.

> The problem seemed to be that the TX cleanup being a multiple of
> budget was allowing one CPU to overwhelm the other and the fact that
> the TX was essentially unbounded was just allowing the issue to
> feedback on itself.

I still don't understand what issue you could even be running into.

On each CPU we round robin against all NAPI requestors for that CPU.

In your routing test setup, we should have one cpu doing the RX and
another different cpu doing TX.

Therefore if the TX cpu simply spins in a loop doing nothing but TX
reclaim work it should not really matter.

And if you hit the TX budget on the TX cpu, it's just going to come
right back into the ixgbe NAPI handler and thus the TX reclaim
processing not even a dozen cycles later.

The only effect is to have us go through the whole function call
sequence and data structure setup into local variables more than you
would be doing so before.

> In addition since the RX and TX workload was balanced it kept both
> locked into polling while the CPU was saturated instead of allowing
> the TX to become interrupt driven.  In addition since the TX was
> working on the same budget as the RX the number of SKBs freed up in
> the TX path would match the number consumed when being reallocated
> on the RX path.

So the only conclusion I can come to is that what happens is we're now
executing what are essentially wasted cpu cycles and this takes us
over the threshold such that we poll more and take interrupts less.
And this improves performance.

That's pretty unwise if you ask me, we should do something useful with
cpu cycles instead of wasting them merely to make us poll more.

> The problem seemed to be present as long as I allowed the TX budget to
> be a multiple of the RX budget.  The easiest way to keep things
> balanced and avoid allowing the TX from one CPU to overwhelm the RX on
> another was just to keep the budgets equal.

You're executing 10 or 20 cpu cycles after every 64 TX reclaims,
that's the only effect of these changes.  That's not even long enough
for a cache line to transfer between two cpus.

  reply	other threads:[~2011-08-22 23:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-21  7:29 [net-next 00/10][pull request] Intel Wired LAN Driver Update Jeff Kirsher
2011-08-21  7:29 ` [net-next 01/10] ixgbe: Simplify transmit cleanup path Jeff Kirsher
2011-08-21  7:29 ` [net-next 02/10] ixgbe: convert rings from q_vector bit indexed array to linked list Jeff Kirsher
2011-08-21  7:29 ` [net-next 03/10] ixgbe: Drop the TX work limit and instead just leave it to budget Jeff Kirsher
2011-08-21 14:01   ` Ben Hutchings
2011-08-22 16:30     ` Alexander Duyck
2011-08-22 16:46       ` Ben Hutchings
2011-08-22 17:29         ` Alexander Duyck
2011-08-22 20:56           ` David Miller
2011-08-22 22:57             ` Alexander Duyck
2011-08-22 23:40               ` David Miller [this message]
2011-08-23  4:04                 ` Alexander Duyck
2011-08-23 20:52                   ` Alexander Duyck
2011-08-21  7:29 ` [net-next 04/10] ixgbe: consolidate all MSI-X ring interrupts and poll routines into one Jeff Kirsher
2011-08-21  7:29 ` [net-next 05/10] ixgbe: cleanup allocation and freeing of IRQ affinity hint Jeff Kirsher
2011-08-21  7:29 ` [net-next 06/10] ixgbe: Use ring->dev instead of adapter->pdev->dev when updating DCA Jeff Kirsher
2011-08-21  7:29 ` [net-next 07/10] ixgbe: commonize ixgbe_map_rings_to_vectors to work for all interrupt types Jeff Kirsher
2011-08-21  7:29 ` [net-next 08/10] ixgbe: Drop unnecessary adapter->hw dereference in loopback test setup Jeff Kirsher
2011-08-21  7:29 ` [net-next 09/10] ixgbe: combine PCI_VDEVICE and board declaration to same line Jeff Kirsher
2011-08-21  7:29 ` [net-next 10/10] ixgbe: Update TXDCTL configuration to correctly handle WTHRESH Jeff Kirsher
2011-08-23 22:45 ` [net-next 00/10][pull request] Intel Wired LAN Driver Update David Miller
2011-08-24  2:34   ` Jeff Kirsher

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=20110822.164027.1830363266993513959.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alexander.h.duyck@intel.com \
    --cc=bhutchings@solarflare.com \
    --cc=gospo@redhat.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    /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).