From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
To: linux-ia64@vger.kernel.org
Subject: [RFC][patch 2/10] Multiple vector domain support - cpu and domain
Date: Thu, 14 Jul 2005 09:20:51 +0000 [thread overview]
Message-ID: <42D62E73.1050108@jp.fujitsu.com> (raw)
This patch add the code to handle the relationship between cpu and
domains. We need more consideration about how to separate vector
domains.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
---
linux-2.6.13-rc1-kanesige/arch/ia64/kernel/irq_ia64.c | 24 ++++++++++++++++++
linux-2.6.13-rc1-kanesige/arch/ia64/kernel/setup.c | 2 +
linux-2.6.13-rc1-kanesige/arch/ia64/kernel/smpboot.c | 2 +
linux-2.6.13-rc1-kanesige/include/asm-ia64/hw_irq.h | 13 +++++++++
4 files changed, 41 insertions(+)
diff -puN arch/ia64/kernel/irq_ia64.c~vector-domain-ia64-attach-cpu arch/ia64/kernel/irq_ia64.c
--- linux-2.6.13-rc1/arch/ia64/kernel/irq_ia64.c~vector-domain-ia64-attach-cpu 2005-07-13 14:51:40.000000000 +0900
+++ linux-2.6.13-rc1-kanesige/arch/ia64/kernel/irq_ia64.c 2005-07-13 14:51:40.000000000 +0900
@@ -286,3 +286,27 @@ ia64_send_ipi (int cpu, int vector, int
writeq(ipi_data, ipi_addr);
}
+
+void __init
+ia64_vector_domain_init (void)
+{
+ /* Attach BSP to domain #0 */
+ ia64_attach_cpu_to_domain(0);
+}
+
+#ifdef CONFIG_VECTOR_DOMAIN
+int ia64_cpu_domain_map[NR_CPUS];
+cpumask_t ia64_domain_cpumask[NR_VECTOR_DOMAINS];
+
+void __devinit
+ia64_attach_cpu_to_domain (int cpu)
+{
+ static int domain = -1;
+
+ /* Simple Round Robin for now */
+ if (++domain >= NR_VECTOR_DOMAINS)
+ domain = 0;
+ ia64_cpu_domain_map[cpu] = domain;
+ cpu_set(cpu, ia64_domain_cpumask[domain]);
+}
+#endif /* CONFIG_VECTOR_DOMAIN */
diff -puN arch/ia64/kernel/setup.c~vector-domain-ia64-attach-cpu arch/ia64/kernel/setup.c
--- linux-2.6.13-rc1/arch/ia64/kernel/setup.c~vector-domain-ia64-attach-cpu 2005-07-13 14:51:40.000000000 +0900
+++ linux-2.6.13-rc1-kanesige/arch/ia64/kernel/setup.c 2005-07-13 14:51:40.000000000 +0900
@@ -406,6 +406,8 @@ setup_arch (char **cmdline_p)
cpu_init(); /* initialize the bootstrap CPU */
+ ia64_vector_domain_init();
+
#ifdef CONFIG_ACPI_BOOT
acpi_boot_init();
#endif
diff -puN arch/ia64/kernel/smpboot.c~vector-domain-ia64-attach-cpu arch/ia64/kernel/smpboot.c
--- linux-2.6.13-rc1/arch/ia64/kernel/smpboot.c~vector-domain-ia64-attach-cpu 2005-07-13 14:51:40.000000000 +0900
+++ linux-2.6.13-rc1-kanesige/arch/ia64/kernel/smpboot.c 2005-07-13 14:51:40.000000000 +0900
@@ -766,6 +766,8 @@ __cpu_up (unsigned int cpu)
int ret;
int sapicid;
+ ia64_attach_cpu_to_domain(cpu);
+
sapicid = ia64_cpu_to_sapicid[cpu];
if (sapicid = -1)
return -EINVAL;
diff -puN include/asm-ia64/hw_irq.h~vector-domain-ia64-attach-cpu include/asm-ia64/hw_irq.h
--- linux-2.6.13-rc1/include/asm-ia64/hw_irq.h~vector-domain-ia64-attach-cpu 2005-07-13 14:51:40.000000000 +0900
+++ linux-2.6.13-rc1-kanesige/include/asm-ia64/hw_irq.h 2005-07-13 14:51:40.000000000 +0900
@@ -79,6 +79,18 @@ enum {
extern __u8 isa_irq_to_vector_map[16];
#define isa_irq_to_vector(x) isa_irq_to_vector_map[(x)]
+#ifdef CONFIG_VECTOR_DOMAIN
+extern void ia64_attach_cpu_to_domain(int cpu);
+extern int ia64_cpu_domain_map[NR_CPUS];
+extern cpumask_t ia64_domain_cpumask[NR_VECTOR_DOMAINS];
+#define ia64_cpu_to_domain(cpu) (ia64_cpu_domain_map[cpu])
+#define ia64_domain_to_cpumask(domain) (ia64_domain_cpumask[domain])
+#else
+#define ia64_attach_cpu_to_domain(cpu) do {} while (0)
+#define ia64_cpu_to_domain(cpu) (cpu^cpu)
+#define ia64_domain_to_cpumask(domain) (cpu_online_map)
+#endif /* CONFIG_VECTOR_DOMAIN */
+
extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */
extern int assign_irq_vector_nopanic (int irq); /* allocate a free vector without panic */
@@ -86,6 +98,7 @@ extern int assign_irq_vector (int irq);
extern void free_irq_vector (int vector);
extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
extern void register_percpu_irq (ia64_vector vec, struct irqaction *action);
+extern void __init ia64_vector_domain_init(void);
static inline void
hw_resend_irq (struct hw_interrupt_type *h, unsigned int vector)
_
next reply other threads:[~2005-07-14 9:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-14 9:20 Kenji Kaneshige [this message]
2005-07-14 18:03 ` [RFC][patch 2/10] Multiple vector domain support - cpu and domain management Ashok Raj
2005-07-14 18:09 ` david mosberger
2005-07-14 18:23 ` [RFC][patch 2/10] Multiple vector domain support - cpu and domain Zwane Mwaikambo
2005-07-16 1:41 ` Kenji Kaneshige
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=42D62E73.1050108@jp.fujitsu.com \
--to=kaneshige.kenji@jp.fujitsu.com \
--cc=linux-ia64@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.