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

Re: [Xen-devel] CONFIG_SPARSE_IRQ breaks single VCPU domain 0 between xen/master and xen/next



On Mon, 2010-03-01 at 09:41 +0000, Ian Campbell wrote:
> 
> Regardless of the mechanism for detecting number of hardware
> interrupts
> required I think we need a mechanism to cause some extra interrupts to
> be available for VIRQ and backend use. I think previously we just been
> lucky that the core code overestimated the number of h/w interrupt
> sources so we got a few free ones for our purposes. It looks like the
> upstream x86 guys are doing some work to make interrupts be more
> dynamically allocated (the radix tree irq_desc stuff) which looks like
> it would be very useful for us once it lands. In 2.6.18 we explicitly
> left space for a number of dynamic IRQs which seems like a reasonable
> approach in the interim, I'll cook up a patch.

How about this vs. xen/xen/dom0/apic-next:

The following changes since commit dc23f2c13cc3c0080af806b318cf63850778c4c2:
  Jeremy Fitzhardinge (1):
        xen/apic: add missing header

are available in the git repository at:

  git://xenbits.xensource.com/people/ianc/linux-2.6.git for-jeremy/apic

Ian Campbell (1):
      xen: allow some overhead in IRQ space for dynamic IRQs

 arch/x86/include/asm/irq_vectors.h |   14 +++++++++++---
 arch/x86/kernel/apic/io_apic.c     |    4 ++++
 arch/x86/xen/enlighten.c           |    4 ++++
 3 files changed, 19 insertions(+), 3 deletions(-)

--- 

>From 6d4a9168207ade237098a401270959ecc0bdd1e9 Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Mon, 1 Mar 2010 11:21:15 +0000
Subject: [PATCH] xen: allow some overhead in IRQ space for dynamic IRQs
 such as VIRQs and backend event channels.

This is an interim solution until x86 interrupts become totally dynamic.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 arch/x86/include/asm/irq_vectors.h |   14 +++++++++++---
 arch/x86/kernel/apic/io_apic.c     |    4 ++++
 arch/x86/xen/enlighten.c           |    4 ++++
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/irq_vectors.h 
b/arch/x86/include/asm/irq_vectors.h
index 5b21f0e..db2aef4 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -157,6 +157,14 @@ static inline int invalid_vm86_irq(int irq)
 #define CPU_VECTOR_LIMIT               (  8 * NR_CPUS      )
 #define IO_APIC_VECTOR_LIMIT           ( 32 * MAX_IO_APICS )
 
+#ifndef __ASSEMBLY__
+# if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SPARSE_IRQ)
+extern int nr_dynamic_irqs;
+# else
+#  define NR_DYNAMIC_IRQS                       256
+# endif
+#endif
+
 #ifdef CONFIG_X86_IO_APIC
 # ifdef CONFIG_SPARSE_IRQ
 #  define NR_IRQS                                      \
@@ -165,13 +173,13 @@ static inline int invalid_vm86_irq(int irq)
                (NR_VECTORS + IO_APIC_VECTOR_LIMIT))
 # else
 #  if NR_CPUS < MAX_IO_APICS
-#   define NR_IRQS                     (NR_VECTORS + 4*CPU_VECTOR_LIMIT)
+#   define NR_IRQS                     (NR_VECTORS + 4*CPU_VECTOR_LIMIT) + 
NR_DYNAMIC_IRQS
 #  else
-#   define NR_IRQS                     (NR_VECTORS + IO_APIC_VECTOR_LIMIT)
+#   define NR_IRQS                     (NR_VECTORS + IO_APIC_VECTOR_LIMIT) + 
NR_DYNAMIC_IRQS
 #  endif
 # endif
 #else /* !CONFIG_X86_IO_APIC: */
-# define NR_IRQS                       NR_IRQS_LEGACY
+# define NR_IRQS                       NR_IRQS_LEGACY + NR_DYNAMIC_IRQS
 #endif
 
 #endif /* _ASM_X86_IRQ_VECTORS_H */
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index c074c1b..3ea627d 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3869,6 +3869,8 @@ int get_nr_irqs_gsi(void)
 }
 
 #ifdef CONFIG_SPARSE_IRQ
+int nr_dynamic_irqs;
+
 int __init arch_probe_nr_irqs(void)
 {
        int nr;
@@ -3886,6 +3888,8 @@ int __init arch_probe_nr_irqs(void)
        if (nr < nr_irqs)
                nr_irqs = nr;
 
+       nr_irqs += nr_dynamic_irqs;
+
        return 0;
 }
 #endif
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 9dea797..421e3ee 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -986,6 +986,10 @@ asmlinkage void __init xen_start_kernel(void)
        pv_apic_ops = xen_apic_ops;
        pv_mmu_ops = xen_mmu_ops;
 
+#ifdef CONFIG_SPARSE_IRQ
+       nr_dynamic_irqs += 256;
+#endif
+
        xen_init_irq_ops();
 
        xen_init_cpuid_mask();
-- 
1.5.6.5





_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.