public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [question] NR_IRQS in genirq
       [not found] ` <alpine.LFD.2.00.1011241416360.2900@localhost6.localdomain6>
@ 2010-11-24 13:46   ` Haojian Zhuang
  2010-11-24 13:50     ` Mark Brown
  2010-11-24 13:53     ` Thomas Gleixner
  0 siblings, 2 replies; 5+ messages in thread
From: Haojian Zhuang @ 2010-11-24 13:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 24, 2010 at 9:18 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Wed, 24 Nov 2010, Haojian Zhuang wrote:
>
>> Hi all,
>>
>> I'm using the latest kernel 2.6.37-rc1. Now I met some issues on genirq.
>>
>> 1. While SPARSE IRQ is enabled, nr_irqs may be larger than NR_IRQS.
>> But the allocated_irqs bitmap (kernel/irq/irqdesc.c) is restricted in
>> NR_IRQS. Is it an issue?
>
> Why can nr_irqs become larger? Is that a theoretical problem or did
> you run into this ?
>
>

Hi Thomas,

My hardware environment is ARM. Each machine description can specify
nr_irqs. In my implementation of PXA, NR_IRQS is fixed for SoC
internal IRQs. And there's some additional board IRQs, we arrange them
between NR_IRQS and nr_irqs. So nr_irqs will be larger than NR_IRQS if
board IRQs exists.

We use dynamic board IRQs since each machine has different
requirement. And CONFIG_HARDIRQ_SW_RESEND is occasionally, I actually
met issue in resend_irqs because of accessing bitmap memory out of
bound.

Do you mean that we shouldn't use SPARSE IRQ by this way?

Best Regards
Haojian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [question] NR_IRQS in genirq
  2010-11-24 13:46   ` [question] NR_IRQS in genirq Haojian Zhuang
@ 2010-11-24 13:50     ` Mark Brown
  2010-11-24 13:54       ` Thomas Gleixner
  2010-11-24 13:53     ` Thomas Gleixner
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2010-11-24 13:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 24, 2010 at 09:46:06PM +0800, Haojian Zhuang wrote:

> My hardware environment is ARM. Each machine description can specify
> nr_irqs. In my implementation of PXA, NR_IRQS is fixed for SoC
> internal IRQs. And there's some additional board IRQs, we arrange them
> between NR_IRQS and nr_irqs. So nr_irqs will be larger than NR_IRQS if
> board IRQs exists.

Most ARM platforms have come up with some Kconfig gunk to allow boards
to extend this for off-SoC GPIOs.  It'd be really nice to get rid of
NR_IRQS and stop having to worry about this at all :(

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [question] NR_IRQS in genirq
  2010-11-24 13:46   ` [question] NR_IRQS in genirq Haojian Zhuang
  2010-11-24 13:50     ` Mark Brown
@ 2010-11-24 13:53     ` Thomas Gleixner
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Gleixner @ 2010-11-24 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 24 Nov 2010, Haojian Zhuang wrote:
> On Wed, Nov 24, 2010 at 9:18 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > Why can nr_irqs become larger? Is that a theoretical problem or did
> > you run into this ?
> 
> My hardware environment is ARM. Each machine description can specify
> nr_irqs. In my implementation of PXA, NR_IRQS is fixed for SoC
> internal IRQs. And there's some additional board IRQs, we arrange them
> between NR_IRQS and nr_irqs. So nr_irqs will be larger than NR_IRQS if
> board IRQs exists.

And that's wrong. NR_IRQS is the upper bound. nr_irqs is the runtime
bound which is supposed to be <= NR_IRQS.

The whole point of sparse_irq is that it does not statically allocate
irq_desc[NR_IRQS] to reduce memory consumption if only a small number
of irqs are actuallt used by a specific board.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [question] NR_IRQS in genirq
  2010-11-24 13:50     ` Mark Brown
@ 2010-11-24 13:54       ` Thomas Gleixner
  2010-11-24 14:00         ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2010-11-24 13:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 24 Nov 2010, Mark Brown wrote:

> On Wed, Nov 24, 2010 at 09:46:06PM +0800, Haojian Zhuang wrote:
> 
> > My hardware environment is ARM. Each machine description can specify
> > nr_irqs. In my implementation of PXA, NR_IRQS is fixed for SoC
> > internal IRQs. And there's some additional board IRQs, we arrange them
> > between NR_IRQS and nr_irqs. So nr_irqs will be larger than NR_IRQS if
> > board IRQs exists.
> 
> Most ARM platforms have come up with some Kconfig gunk to allow boards
> to extend this for off-SoC GPIOs.  It'd be really nice to get rid of
> NR_IRQS and stop having to worry about this at all :(

I mean with sparse_irq you can set NR_IRQS insanely high w/o
increasing memory consumption. That's the whole point.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [question] NR_IRQS in genirq
  2010-11-24 13:54       ` Thomas Gleixner
@ 2010-11-24 14:00         ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2010-11-24 14:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 24, 2010 at 02:54:38PM +0100, Thomas Gleixner wrote:
> On Wed, 24 Nov 2010, Mark Brown wrote:
> > On Wed, Nov 24, 2010 at 09:46:06PM +0800, Haojian Zhuang wrote:

> > Most ARM platforms have come up with some Kconfig gunk to allow boards
> > to extend this for off-SoC GPIOs.  It'd be really nice to get rid of
> > NR_IRQS and stop having to worry about this at all :(

> I mean with sparse_irq you can set NR_IRQS insanely high w/o
> increasing memory consumption. That's the whole point.

Yeah, I was just pointing out common practice on ARM (sparse IRQ isn't
widely enough deployed there :/ ).

Would it be worth having sparse_irq change the default NR_IRQS to be
something suitably large - there doesn't seem any point in having
platforms using it each pick their own particular definition of insanely
high?  I'll take a look and cook up a patch unless I can spot anything
silly about that by myself.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-24 14:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <AANLkTimoBdFyQ6GfS2DKiF0wdRox0x7MfM0_keD9Z1D0@mail.gmail.com>
     [not found] ` <alpine.LFD.2.00.1011241416360.2900@localhost6.localdomain6>
2010-11-24 13:46   ` [question] NR_IRQS in genirq Haojian Zhuang
2010-11-24 13:50     ` Mark Brown
2010-11-24 13:54       ` Thomas Gleixner
2010-11-24 14:00         ` Mark Brown
2010-11-24 13:53     ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox