Re: [PATCH] X86: Change the default value of nr_irqs from 32 to NR_IRQs

Previous thread: 2.6.26/tg3 ping roundtrip times > 2000 ms on local network by Marc Haber on Tuesday, August 19, 2008 - 1:20 pm. (10 messages)

Next thread: [PATCH 1/5] ide: use unique names for struct pci_driver instances by Bartlomiej Zolnierkiewicz on Tuesday, August 19, 2008 - 2:30 pm. (1 message)
To: Alex Nixon (Intern) <Alex.Nixon@...>
Cc: Ingo Molnar <mingo@...>, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, August 19, 2008 - 2:24 pm

On Tue, Aug 19, 2008 at 11:13 AM, Alex Nixon (Intern)

can you try !CONFIG_HAVE_SPARSE_IRQ and CONFIG_HAVE_SPARSE_IRQ ?

YH
--

To: Yinghai Lu <yhlu.kernel@...>
Cc: Ingo Molnar <mingo@...>, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, August 19, 2008 - 2:32 pm

Sorry I should have mentioned originally - the bug occurs both with
CONFIG_HAVE_SPARSE_IRQ enabled, and disabled.

- Alex
--

To: Alex Nixon <alex.nixon@...>
Cc: Ingo Molnar <mingo@...>, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, August 19, 2008 - 3:00 pm

maybe we need special probe_nr_irqs for PV or not call that in
setup_arch for xen -- it will leave nr_irqs == NR_IRQS

YH
--

To: Yinghai Lu <yhlu.kernel@...>
Cc: Ingo Molnar <mingo@...>, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, August 19, 2008 - 3:50 pm

That would be one solution, but would be more involved than this trivial
patch (although if considered more 'correct' then it is of course worth
the effort).
But attempting to keep things simple, is there a reason it's
preferable to fall back to 32 rather NR_IRQS?

- Alex
--

To: Alex Nixon <alex.nixon@...>
Cc: Ingo Molnar <mingo@...>, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, August 19, 2008 - 4:52 pm

when !CONFIG_HAVE_SPARSE_IRQ, with dyn_array, could allocate irq_desc
and etc as less as possible.
when CONFIG_HAVE_SPARESE_IRQ, no actually meaning for nr_irqs.

YH
--

To: Yinghai Lu <yhlu.kernel@...>
Cc: Ingo Molnar <mingo@...>, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, August 19, 2008 - 7:19 pm

So I believe the only case this affects is !CONFIG_HAVE_SPARSE_IRQ

The worry is that with CONFIG_HAVE_DYN_ARRAY we may waste memory by
pre-allocating more irq_descs than may be necessary (NR_IRQs vs 32)?

With !CONFIG_HAVE_DYN_ARRAY however, a static array of size NR_IRQS is
allocated instead - so doesn't defaulting nr_irqs back to NR_IRQS just
revert to the old behaviour (with the exception of the irq_descs being
allocated in pre_alloc_dyn_array instead)?

- Alex
--

To: Yinghai Lu <yhlu.kernel@...>
Cc: Ingo Molnar <mingo@...>, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Wednesday, August 20, 2008 - 7:23 pm

Sorry to pester you Yinghai, but I'd like to get a patch for this out
one way or another as Xen is _completely_ unusable with 5 or more VCPUs.

Can you explain more clearly what the problem with the patch is?

I have a different patch set which solves the problem by adding in a pv
hook for probe_nr_irqs, but it's by far less clean.

Or alternatively, we could revert your patch b2e5f326bb

Cheers,
- Alex
--

To: Alex Nixon <alex.nixon@...>
Cc: Ingo Molnar <mingo@...>, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Wednesday, August 20, 2008 - 7:47 pm

small real system doesn't have MSI ioapic will have nr_irqs == 32.
your patch will increase that to 224 again.

sth like ?

#ifdef CONFIG_XEN
int __init probe_nr_irqs(void)
{
int idx;
int nr = 0;

for (idx = 0; idx < nr_ioapics; idx++)
nr += io_apic_get_redir_entries(idx);

/* double it for hotplug and msi and nmi */
nr <<= 1;

/* something wrong ? */
if (nr < 32)
nr = 32;

return nr;
}
#else
int __init probe_nr_irqs(void)
{
return NR_IRQS;
}
#endif
--

To: Yinghai Lu <yhlu.kernel@...>
Cc: Alex Nixon <alex.nixon@...>, Ingo Molnar <mingo@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Thursday, August 21, 2008 - 7:21 pm

No. A Xen-capable kernel can also run native, so it must do whatever a
normal kernel would do when booting native.

At what point in the boot does nr_irqs need to be set? Could we just

J
--

Previous thread: 2.6.26/tg3 ping roundtrip times > 2000 ms on local network by Marc Haber on Tuesday, August 19, 2008 - 1:20 pm. (10 messages)

Next thread: [PATCH 1/5] ide: use unique names for struct pci_driver instances by Bartlomiej Zolnierkiewicz on Tuesday, August 19, 2008 - 2:30 pm. (1 message)