From: Grant Likely <grant.likely@secretlab.ca>
To: Michael Ellerman <michael@ellerman.id.au>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 6/6] powerpc: Enable sparse irq_descs on powerpc
Date: Wed, 14 Oct 2009 12:44:22 -0600 [thread overview]
Message-ID: <fa686aa40910141144y1776c476uc8e26e06eb57e6ac@mail.gmail.com> (raw)
In-Reply-To: <91cec5c64da4ca31a025fc7c45d9f1b93c8b98da.1255499081.git.michael@ellerman.id.au>
On Tue, Oct 13, 2009 at 11:45 PM, Michael Ellerman
<michael@ellerman.id.au> wrote:
> Defining CONFIG_SPARSE_IRQ enables generic code that gets rid of the
> static irq_desc array, and replaces it with an array of pointers to
> irq_descs.
>
> It also allows node local allocation of irq_descs, however we
> currently don't have the information available to do that, so we just
> allocate them on all on node 0.
>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Why not make sparse IRQs manditory for all platforms? Is there a
performance concern with doing so? From a maintenance perspective,
I'd rather see IRQ descs manged in one way only to keep the code
simple.
Cheers,
g.
> ---
> =A0arch/powerpc/Kconfig =A0 =A0 =A0 =A0 =A0 =A0| =A0 13 ++++++++++++
> =A0arch/powerpc/include/asm/irq.h =A0| =A0 =A03 ++
> =A0arch/powerpc/kernel/irq.c =A0 =A0 =A0 | =A0 40 +++++++++++++++++++++++=
+++++++++------
> =A0arch/powerpc/kernel/ppc_ksyms.c | =A0 =A01 -
> =A0arch/powerpc/kernel/setup_64.c =A0| =A0 =A05 ----
> =A05 files changed, 49 insertions(+), 13 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 2230e75..825d889 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -388,6 +388,19 @@ config IRQ_ALL_CPUS
> =A0 =A0 =A0 =A0 =A0CPU. =A0Generally saying Y is safe, although some prob=
lems have been
> =A0 =A0 =A0 =A0 =A0reported with SMP Power Macintoshes with this option e=
nabled.
>
> +config SPARSE_IRQ
> + =A0 =A0 =A0 bool "Support sparse irq numbering"
> + =A0 =A0 =A0 default y
> + =A0 =A0 =A0 help
> + =A0 =A0 =A0 =A0 This enables support for sparse irqs. This is useful fo=
r distro
> + =A0 =A0 =A0 =A0 kernels that want to define a high CONFIG_NR_CPUS value=
but still
> + =A0 =A0 =A0 =A0 want to have low kernel memory footprint on smaller mac=
hines.
> +
> + =A0 =A0 =A0 =A0 ( Sparse IRQs can also be beneficial on NUMA boxes, as =
they spread
> + =A0 =A0 =A0 =A0 =A0 out the irq_desc[] array in a more NUMA-friendly wa=
y. )
> +
> + =A0 =A0 =A0 =A0 If you don't know what to do here, say Y.
> +
> =A0config NUMA
> =A0 =A0 =A0 =A0bool "NUMA support"
> =A0 =A0 =A0 =A0depends on PPC64
> diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/ir=
q.h
> index 03dc28c..c85a32f 100644
> --- a/arch/powerpc/include/asm/irq.h
> +++ b/arch/powerpc/include/asm/irq.h
> @@ -38,6 +38,9 @@ extern atomic_t ppc_n_lost_interrupts;
> =A0/* Number of irqs reserved for the legacy controller */
> =A0#define NUM_ISA_INTERRUPTS =A0 =A0 16
>
> +/* Same thing, used by the generic IRQ code */
> +#define NR_IRQS_LEGACY =A0 =A0 =A0 =A0 NUM_ISA_INTERRUPTS
> +
> =A0/* This type is the placeholder for a hardware interrupt number. It ha=
s to
> =A0* be big enough to enclose whatever representation is used by a given
> =A0* platform.
> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> index 63e27d5..eba5392 100644
> --- a/arch/powerpc/kernel/irq.c
> +++ b/arch/powerpc/kernel/irq.c
> @@ -85,7 +85,10 @@ extern int tau_interrupts(int);
> =A0#endif /* CONFIG_PPC32 */
>
> =A0#ifdef CONFIG_PPC64
> +
> +#ifndef CONFIG_SPARSE_IRQ
> =A0EXPORT_SYMBOL(irq_desc);
> +#endif
>
> =A0int distribute_irqs =3D 1;
>
> @@ -613,8 +616,16 @@ void irq_set_virq_count(unsigned int count)
> =A0static int irq_setup_virq(struct irq_host *host, unsigned int virq,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0irq_hw_number_t hw=
irq)
> =A0{
> + =A0 =A0 =A0 struct irq_desc *desc;
> +
> + =A0 =A0 =A0 desc =3D irq_to_desc_alloc_node(virq, 0);
> + =A0 =A0 =A0 if (!desc) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 pr_debug("irq: -> allocating desc failed\n"=
);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto error;
> + =A0 =A0 =A0 }
> +
> =A0 =A0 =A0 =A0/* Clear IRQ_NOREQUEST flag */
> - =A0 =A0 =A0 irq_to_desc(virq)->status &=3D ~IRQ_NOREQUEST;
> + =A0 =A0 =A0 desc->status &=3D ~IRQ_NOREQUEST;
>
> =A0 =A0 =A0 =A0/* map it */
> =A0 =A0 =A0 =A0smp_wmb();
> @@ -623,11 +634,14 @@ static int irq_setup_virq(struct irq_host *host, un=
signed int virq,
>
> =A0 =A0 =A0 =A0if (host->ops->map(host, virq, hwirq)) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pr_debug("irq: -> mapping failed, freeing\=
n");
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_free_virt(virq, 1);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto error;
> =A0 =A0 =A0 =A0}
>
> =A0 =A0 =A0 =A0return 0;
> +
> +error:
> + =A0 =A0 =A0 irq_free_virt(virq, 1);
> + =A0 =A0 =A0 return -1;
> =A0}
>
> =A0unsigned int irq_create_direct_mapping(struct irq_host *host)
> @@ -1008,12 +1022,24 @@ void irq_free_virt(unsigned int virq, unsigned in=
t count)
> =A0 =A0 =A0 =A0spin_unlock_irqrestore(&irq_big_lock, flags);
> =A0}
>
> -void irq_early_init(void)
> +int arch_early_irq_init(void)
> =A0{
> - =A0 =A0 =A0 unsigned int i;
> + =A0 =A0 =A0 struct irq_desc *desc;
> + =A0 =A0 =A0 int i;
>
> - =A0 =A0 =A0 for (i =3D 0; i < NR_IRQS; i++)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_to_desc(i)->status |=3D IRQ_NOREQUEST;
> + =A0 =A0 =A0 for (i =3D 0; i < NR_IRQS; i++) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 desc =3D irq_to_desc(i);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (desc)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 desc->status |=3D IRQ_NOREQ=
UEST;
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 return 0;
> +}
> +
> +int arch_init_chip_data(struct irq_desc *desc, int node)
> +{
> + =A0 =A0 =A0 desc->status |=3D IRQ_NOREQUEST;
> + =A0 =A0 =A0 return 0;
> =A0}
>
> =A0/* We need to create the radix trees late */
> diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ks=
yms.c
> index c8b27bb..07115d6 100644
> --- a/arch/powerpc/kernel/ppc_ksyms.c
> +++ b/arch/powerpc/kernel/ppc_ksyms.c
> @@ -162,7 +162,6 @@ EXPORT_SYMBOL(screen_info);
>
> =A0#ifdef CONFIG_PPC32
> =A0EXPORT_SYMBOL(timer_interrupt);
> -EXPORT_SYMBOL(irq_desc);
> =A0EXPORT_SYMBOL(tb_ticks_per_jiffy);
> =A0EXPORT_SYMBOL(cacheable_memcpy);
> =A0EXPORT_SYMBOL(cacheable_memzero);
> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_6=
4.c
> index 797ea95..8e5ec92 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -357,11 +357,6 @@ void __init setup_system(void)
> =A0 =A0 =A0 =A0 */
> =A0 =A0 =A0 =A0initialize_cache_info();
>
> - =A0 =A0 =A0 /*
> - =A0 =A0 =A0 =A0* Initialize irq remapping subsystem
> - =A0 =A0 =A0 =A0*/
> - =A0 =A0 =A0 irq_early_init();
> -
> =A0#ifdef CONFIG_PPC_RTAS
> =A0 =A0 =A0 =A0/*
> =A0 =A0 =A0 =A0 * Initialize RTAS if available
> --
> 1.6.2.1
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
next prev parent reply other threads:[~2009-10-14 18:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 5:44 [PATCH 1/6] powerpc: Make NR_IRQS a CONFIG option Michael Ellerman
2009-10-14 5:44 ` [PATCH 2/6] powerpc/pseries: Use irq_has_action() in eeh_disable_irq() Michael Ellerman
2009-10-14 18:33 ` Grant Likely
2009-10-14 5:44 ` [PATCH 3/6] powerpc: Remove get_irq_desc() Michael Ellerman
2009-10-14 19:02 ` Grant Likely
2009-10-14 5:44 ` [PATCH 4/6] powerpc: Make virq_debug_show() cope with sparse irq_descs Michael Ellerman
2009-10-14 18:34 ` Grant Likely
2009-10-14 5:45 ` [PATCH 5/6] powerpc: Rearrange and fix show_interrupts() for " Michael Ellerman
2009-10-14 18:37 ` Grant Likely
2009-10-14 5:45 ` [PATCH 6/6] powerpc: Enable sparse irq_descs on powerpc Michael Ellerman
2009-10-14 18:44 ` Grant Likely [this message]
2009-10-14 23:51 ` Michael Ellerman
2009-10-15 0:33 ` Grant Likely
2009-10-14 18:59 ` [PATCH 1/6] powerpc: Make NR_IRQS a CONFIG option Grant Likely
2009-10-14 23:47 ` Michael Ellerman
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=fa686aa40910141144y1776c476uc8e26e06eb57e6ac@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=linuxppc-dev@ozlabs.org \
--cc=michael@ellerman.id.au \
/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).