Re: [PATCH V19 07/13] MIPS: Loongson 3: Add IRQ init and dispatch support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 19, 2014 at 11:05:34AM +0800, "陈华才" wrote:

> >> +{
> >> +	unsigned int i, irq;
> >> +	unsigned int ht_irq[] = {1, 3, 4, 5, 6, 7, 8, 12, 14, 15};
> >> +
> >> +	irq = LOONGSON_HT1_INT_VECTOR(0);
> >> +	LOONGSON_HT1_INT_VECTOR(0) = irq; /* Acknowledge the IRQs */
> >> +
> >> +	for (i = 0; i < ARRAY_SIZE(ht_irq); i++) {
> >> +		if (irq & (0x1 << ht_irq[i]))
> >> +			do_IRQ(ht_irq[i]);
> >> +	}
> >> +}
> >
> > Ouch.
> >
> > Initializing an array like this in C will generate code which at runtime
> > initializes the ht_irq[] array each time ht_irqdispatch is invoked
> > and slowing this function to a crawl.
> >
> > You want to make either move the definition of this array out of the
> > function body or make it "static const unsigned int ht_irq[] ..." to
> > avoid this.
> Since there are several patches have problem, and the first one is
> merged, I will send a V20 patchset without the first one ASAP.

Great.  I'll then drop V19 from patchwork.

Thanks,

  Ralf


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux