linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Mark Lord <lkml@rtr.ca>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@osdl.org>, Ingo Molnar <mingo@elte.hu>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: CONFIG_IRQBALANCE for 64-bit x86 ?
Date: Tue, 20 Nov 2007 18:37:39 +1100	[thread overview]
Message-ID: <200711201837.39664.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <20071119213727.16d5917b@laptopd505.fenrus.org>

On Tuesday 20 November 2007 16:37, Arjan van de Ven wrote:
> On Tue, 20 Nov 2007 15:17:15 +1100

> > For that matter, I'd like to know why it has been decided that the
> > best place for IRQ balancing is in userspace. It should be in kernel
> > IMO, and it would probably allow better power saving, performance,
> > fairness, etc. if it were to be integrated with the task balancer as
> > well.
>
> actually.... no. IRQ balancing is not a "fast" decision; every time you

I didn't say anything of the sort. But IRQ load could still fluctuate
a lot more rapidly than we'd like to wake up the irqbalancer.


> move an interrupt around, you end up causing a really a TON of cache
> line bounces, and generally really bad performance

All the more reason why the kernel should do it. When I say move it to
the kernel, I don't mean because I want to move IRQs 1 000 000 times
per second and can't sustain enough context switches to do it in
userspace. Userspace basically has insufficient information to do it
as well as kernel.

We do task balancing in the kernel too, it's a pretty similar problem
(although granted it is less feasible for userspace because tasks are
created and destroyed very often)


> (esp if you do it 
> for networking ones, since you destroy the packet reassembly stuff in
> the tcp/ip stack).
>
> Instead, what ends up working is if you do high level categories of
> interrupt classes and balance within those (so that no 2 networking
> irqs are on the same core/package unless you have more nics than cores)

Sure, but you say that like it is difficult information for the kernel
to know about. Actually it is much easier. Note that you can still
bind interrupts to specific CPUs.


> etc. Balancing on a 10 second scale seems to work quite well; no need
> to pull that complexity into the kernel....

My perspective is that it isn't a good idea to have such a critical
piece of infrastructure outside the kernel.

I want the kernel to balance interrupts and tasks fairly; maybe move
interrupts closer to the tasks they are interacting with (instead of,
or combined with our current policy of moving tasks near the interrupts,
which can be much more damaging for cache and NUMA); move all interrupts
to a single core when there is enough capacity and we are balancing for
power savings; do exponential interrupt balancing backoff when it isn't
required; etc. Not easy to do all that in userspace.

Any reason you actually think it is a good idea, aside from the fact
that a userspace solution was able to be better than a crappy old
kernel one?

  reply	other threads:[~2007-11-20  7:37 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-20  4:12 CONFIG_IRQBALANCE for 64-bit x86 ? Mark Lord
2007-11-20  4:15 ` Ismail Dönmez
2007-11-20  4:17 ` Nick Piggin
2007-11-20  4:29   ` Willy Tarreau
2007-11-20  4:37     ` Adrian Bunk
2007-11-20  5:24       ` Nick Piggin
2007-11-20  5:28         ` H. Peter Anvin
2007-11-20  5:37   ` Arjan van de Ven
2007-11-20  7:37     ` Nick Piggin [this message]
2007-11-20 14:47       ` Arjan van de Ven
2007-11-20 15:43         ` Nick Piggin
2007-11-20 19:07           ` Arjan van de Ven
2007-11-20 20:02             ` Mark Lord
2007-11-20 21:58               ` Arjan van de Ven
2007-11-20 23:17                 ` Mark Lord
2007-11-22  7:54             ` Nick Piggin
2007-11-23 13:09               ` Ingo Molnar
2007-11-25 10:03                 ` Nick Piggin
2007-11-20 15:47         ` Mark Lord
2007-11-20 15:52           ` Mark Lord
2007-11-20 16:02             ` Arjan van de Ven
2007-11-20 16:10               ` Mark Lord
2007-11-20 18:42               ` Mark Lord
2007-11-20 22:01         ` Ingo Molnar
2007-11-20 23:22           ` Mark Lord
2007-11-20 23:27             ` Ingo Molnar
2007-11-20 23:33               ` H. Peter Anvin
2007-11-20 23:47                 ` Ingo Molnar
2007-11-20 23:50                   ` H. Peter Anvin
2007-11-21  0:07                     ` Ingo Molnar
2007-11-21  0:20                       ` H. Peter Anvin
2007-11-21  0:36                         ` Ingo Molnar
2007-11-21  0:47                           ` H. Peter Anvin
2007-11-21  2:48                           ` Jeff Garzik
2007-11-21  2:59                             ` H. Peter Anvin
2007-11-20 23:28             ` H. Peter Anvin
2007-11-20 19:17   ` Andi Kleen
2007-11-21  2:22 Walt H

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=200711201837.39664.nickpiggin@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@rtr.ca \
    --cc=mingo@elte.hu \
    --cc=torvalds@osdl.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).