From: ebiederm@xmission.com (Eric W. Biederman)
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Arthur Kepner <akepner@sgi.com>,
linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [RFC/PATCHv2] x86/irq: round-robin distribution of irqs to cpus w/in node
Date: Tue, 28 Sep 2010 03:59:33 -0700 [thread overview]
Message-ID: <m1eicennfu.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <alpine.LFD.2.00.1009280957150.2416@localhost6.localdomain6> (Thomas Gleixner's message of "Tue, 28 Sep 2010 10:08:52 +0200 (CEST)")
Thomas Gleixner <tglx@linutronix.de> writes:
> On Mon, 27 Sep 2010, Eric W. Biederman wrote:
>> > On Mon, 27 Sep 2010, Arthur Kepner wrote:
>> The deep bug is that create_irq_nr allocates a vector (which it does
>> because at the time there was no better way to mark an irq in use on
>> x86). In the case of msi-x we really don't know the node that irq is
>> going to be used on until we get a request irq. We simply know which
>> node the device is on.
>
> Bah. So the whole per node allocation business is completely useless
> at this point.
Probably.
>> If you want to see what is going follow the call trace looks like.
>> pci_enable_msix
>> arch_setup_msi_irqs
>> create_irq_nr
>>
>> After pci_enable_msix is finished then the driver goes and makes all
>> of the irqs per cpu irqs.
>>
>> There are goofy things that happen when hardware asks for 1 irq per cpu.
>> But since msi can ask for up to 4096 irqs (assuming the hardware
>> supports it) I can totally see putting all 256 of those irqs on a single
>> cpu, before you go to user space and let user space or something
>> reassign all of those irqs in a per cpu way.
>>
>> My gut feel says that the real answer is to delay assigning a vector
>> to an irq until request_irq(). At which point we will know that someone
>> at least wants to use the irq.
>
> Right. So the solution would be:
>
> create_irq allocates an irq number + irq descriptor, nothing else
>
> chip->startup() will setup the vector and chip->shutdown releases
> it. That requires to change the return value of chip->startup to int,
> so we can return an error code, but that can be done in course of the
> overhaul I'm working on.
>
> Right now I prefer not to add more crap to io_apic.c, it's horrible
> enough already. I'll fix that with the cleanup.
Understood. It has taken a couple of years before this bug finally
bit anyone waiting a release or two to get it fixed properly seems
reasonable.
pci_enable_msix all in it's own way is fixable, but it has
few enough callers < 80 that it is also fixable.
drivers/pci/msi.c and drivers/pci/htirq.c are interesting in
that they are arch independent users of the generiq layer. Which
is why msi_desc needed a new field.
Eric
next prev parent reply other threads:[~2010-09-28 10:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-27 20:34 [RFC/PATCHv2] x86/irq: round-robin distribution of irqs to cpus w/in node Arthur Kepner
2010-09-27 20:46 ` Thomas Gleixner
2010-09-27 22:01 ` Arthur Kepner
2010-09-27 22:12 ` Thomas Gleixner
2010-09-28 0:17 ` Eric W. Biederman
2010-09-28 8:08 ` Thomas Gleixner
2010-09-28 10:59 ` Eric W. Biederman [this message]
2010-09-29 17:19 ` Arthur Kepner
2010-09-29 18:05 ` Thomas Gleixner
2010-10-17 10:44 ` Thomas Gleixner
2010-10-19 23:58 ` Arthur Kepner
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=m1eicennfu.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=akepner@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.