Netdev List
 help / color / mirror / Atom feed
From: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
To: David Miller <davem@davemloft.net>
Cc: "Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
	"gospo@redhat.com" <gospo@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [net-next-2.6 PATCH 2/3] ixgbe: Set MSI-X vectors to NOBALANCING and set affinity
Date: Thu, 22 Oct 2009 01:22:36 -0700	[thread overview]
Message-ID: <1256199756.2634.65.camel@ppwaskie-mobl2> (raw)
In-Reply-To: <20091021.215031.57955781.davem@davemloft.net>

On Wed, 2009-10-21 at 21:50 -0700, David Miller wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Date: Tue, 20 Oct 2009 19:27:14 -0700
> 
> > From: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> > 
> > This patch will set each MSI-X vector to IRQF_NOBALANCING to
> > prevent autobalance of the interrupts, then applies a CPU
> > affinity.  This will only be done when Flow Director is enabled,
> > which needs interrupts to be processed on the same CPUs where the
> > applications are running.
> > 
> > Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> 
> Just explain to me why irqbalanced in userspace cannot take care
> of this issue.

The problem we have is when Flow Director is enabled, we want to try and
balance the applications across all CPUs.  irqbalance is going to fight
with the scheduler to balance things, and our tests show that irqbalance
only utilizes a few of the CPU cores, not all of them.  That fights
directly with Flow Director and what it's trying to do.

> Second, even if we cannot use irqbalanced for some reason, the last
> thing I want to see is drivers directly fiddling with interrupt
> states and attributes.  Every driver is going to do it every so
> slightly differently, and often will get it wrong.

The first thing any performance guide says is to disable irqbalance, and
affinitize the interrupts in /proc/irq/<irq>/smp_affinity.  This will
ensure the best distribution of work.  The major disadvantage in doing
this is disabling irqbalance affects the entire system.  What this
patchset is trying to do is make sure a single driver, trying to
optimize for performance, doesn't need to affect the entire system.
Setting no-balancing on a vector is the best approach for the entire
system.

I completely understand your concern that this opens precedent for other
drivers to potentially start doing crazy things with interrupts, but
with MSI-X, we're only impacting our driver.

> There is also no global policy or policy control available when
> drivers do this stuff directly.  And that's how we end up with
> situations where every driver behaves differently which results in a
> terrible user experience.

Again, I think the overall impact is worse where the normal approach to
performance tuning is to altogether disable irqbalancing.  The same
effect can be attained by a user disabling irqbalance, and assigning
whatever affinity they want, which could be even more devastating.  What
we're trying to do here is have the driver come as best tuned out of the
box as possible.

If there's something about this particular implementation you're not
comfortable with, I'm very willing to take any feedback on it.  We're
trying to do a specific thing, not lead poor design in drivers when
dealing with interrupts.

Regards,
-PJ Waskiewicz


  reply	other threads:[~2009-10-22  8:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-21  2:26 [net-next-2.6 PATCH 1/3] irq: Export irq_set_affinity() for drivers Jeff Kirsher
2009-10-21  2:27 ` [net-next-2.6 PATCH 2/3] ixgbe: Set MSI-X vectors to NOBALANCING and set affinity Jeff Kirsher
2009-10-22  4:50   ` David Miller
2009-10-22  8:22     ` Peter P Waskiewicz Jr [this message]
2009-10-22 10:56       ` David Miller
2009-10-22 21:45         ` Stephen Hemminger
2009-11-12 19:12     ` Waskiewicz Jr, Peter P
2009-11-18 18:10       ` David Miller
2009-11-18 19:46         ` Ben Hutchings
2009-11-18 19:50           ` David Miller
2009-11-19  1:14             ` Peter P Waskiewicz Jr
2009-11-19  6:28               ` David Miller
2009-10-21  2:27 ` [net-next-2.6 PATCH 3/3] ixgbe: Make queue pairs on single MSI-X interrupts Jeff Kirsher
2009-10-21 15:35 ` [net-next-2.6 PATCH 1/3] irq: Export irq_set_affinity() for drivers Ben Hutchings

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=1256199756.2634.65.camel@ppwaskie-mobl2 \
    --to=peter.p.waskiewicz.jr@intel.com \
    --cc=davem@davemloft.net \
    --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