From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Andi Kleen <ak@suse.de>, Ingo Molnar <mingo@elte.hu>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [RFC] killing the NR_IRQS arrays.
Date: Mon, 19 Feb 2007 06:58:03 +1100 [thread overview]
Message-ID: <1171828684.5644.167.camel@localhost.localdomain> (raw)
In-Reply-To: <m1lkiw9i53.fsf@ebiederm.dsl.xmission.com>
> Because I don't have something better to replace them with.
>
> We need names for irqs, currently the kernel/user space interface
> is a unsigned number.
.../...
Ok, as long as it's strictly a userspace issue, I understand.
> The model can be made to work if you force it but it isn't really
> a good fit.
>
> I can't really use the (cpu#, vector#) tuple as hw number as it
> varies at runtime, and a single interrupt can send different (cpu#,
> vector#) tuples from one interrupt message to the next without being
> reprogrammed. At least I don't have the impression that you support
> multiple hardware numbers going to the same linux irq. But this
> really is the layer where I need the reverse mapping. However I can
> optimize the reverse mapping by taking advantage of the per cpu
> nature.
>
> Currently the hardware number that I use is the pin number on
> the ioapic. And to form the linux irq I just add the number
> of pins of all previous ioapics together and then add my pin number.
> Fairly simple.
Ok.
> Doing the above gives me stable names that are the same from one boot
> to the next if someone doesn't change how the hardware is put
> together. It looks to me that if I adapt the ppc scheme my irq
> numbers will change from one boot to the next one kernel to the next,
> almost at random.
Not necessarily. The current code would though in practice, it doesn't
change much, but as I said, it would be trivial to change it so that a
domain using a linear reverse map is fully "allocated" when initialized.
Stable numbers are somewhat useful for users, thus one of the thing the
ppc code tries to do in order to get "mostly" stable numbers/names as
well is to try to use the HW number as a "starting" value when searching
for a linux irq number to assign. Only if it's not possible (the HW
number is in the reserved ISA range, too big, or the matching linux
number is already used) then it will allocate a new one.
I still think I need to add the domain and HW number to /proc/interrupts
though (or to some other sysfs file) in order to provide the mappign to
virqs to userland.
Also, if the eixsting linear and radix tree reverse maps don't fit your
needs, you can create a new one or request no reverse map from the core
at all and do everything in your arch code.
Basically, what I'm saying is that I'd like the concept of domain &
generic remappers to become generic. sparc64 and ppc use it and I'm
convinced it would be useful to other especially archs with lots of
cascaded PICs like ARM. And by doing so, we can also make it easier to
expose the HW -> virq mapping to userland in a common place with a
consistent format since it would be done by generic code.
Cheers,
Ben.
prev parent reply other threads:[~2007-02-18 19:58 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-16 12:10 [RFC] killing the NR_IRQS arrays Eric W. Biederman
2007-02-16 12:16 ` Andi Kleen
2007-02-16 15:35 ` Eric W. Biederman
2007-02-16 12:41 ` Ingo Molnar
2007-02-16 15:23 ` Eric W. Biederman
2007-02-16 15:49 ` Eric W. Biederman
2007-02-16 22:33 ` Benjamin Herrenschmidt
2007-02-18 21:24 ` Arjan van de Ven
2007-02-19 0:25 ` Benjamin Herrenschmidt
2007-02-27 20:29 ` Eric W. Biederman
2007-02-28 0:41 ` Arnd Bergmann
2007-02-28 7:20 ` Eric W. Biederman
2007-02-28 8:09 ` Benjamin Herrenschmidt
2007-02-28 13:28 ` Eric W. Biederman
2007-02-28 12:24 ` Arnd Bergmann
2007-02-28 13:02 ` Segher Boessenkool
2007-02-28 13:53 ` Eric W. Biederman
2007-03-01 10:47 ` Benjamin Herrenschmidt
2007-02-16 18:07 ` Jeremy Fitzhardinge
2007-02-16 19:01 ` Eric W. Biederman
2007-02-16 19:06 ` Jeremy Fitzhardinge
2007-02-16 19:45 ` Arnd Bergmann
2007-02-16 19:52 ` Russell King
2007-02-16 20:43 ` Arnd Bergmann
2007-02-16 20:59 ` Russell King
2007-02-16 22:37 ` Benjamin Herrenschmidt
2007-02-17 1:37 ` Arnd Bergmann
2007-02-17 4:00 ` Benjamin Herrenschmidt
2007-02-17 9:06 ` Eric W. Biederman
2007-02-17 21:15 ` Benjamin Herrenschmidt
2007-02-18 6:30 ` Eric W. Biederman
2007-02-18 20:01 ` Benjamin Herrenschmidt
2007-02-17 9:34 ` Eric W. Biederman
2007-02-17 21:20 ` Benjamin Herrenschmidt
2007-02-18 3:58 ` Eric W. Biederman
2007-02-16 22:29 ` Benjamin Herrenschmidt
2007-02-17 8:51 ` Eric W. Biederman
2007-02-17 21:04 ` Benjamin Herrenschmidt
2007-02-18 4:58 ` Eric W. Biederman
2007-02-18 19:58 ` Benjamin Herrenschmidt [this message]
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=1171828684.5644.167.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=ebiederm@xmission.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=torvalds@linux-foundation.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).