public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Martin J. Bligh" <mbligh@aracnet.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] 6/8 Move NUMA-Q support into subarch
Date: Sun, 22 Dec 2002 22:56:37 -0800	[thread overview]
Message-ID: <61840000.1040626597@titus> (raw)

Reformat the IPI stuff, specifically send_IPI_mask,
send_IPI_allbutself, and send_IPI_all. Though the way they
work is pretty silly for NUMA-Q, I do an equivalent transform
here, and fix the code in a seperate patch (next one).
Goes into mach_ipi.h


diff -urpN -X /home/fletch/.diff.exclude 14-numaq4/arch/i386/kernel/smp.c 15-numaq5/arch/i386/kernel/smp.c
--- 14-numaq4/arch/i386/kernel/smp.c	Sun Nov 17 20:29:22 2002
+++ 15-numaq5/arch/i386/kernel/smp.c	Sun Dec 22 12:11:09 2002
@@ -24,6 +24,7 @@
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/smpboot.h>
+#include <mach_ipi.h>
 
 /*
  *	Some notes on x86 processor bugs affecting SMP operation:
@@ -225,54 +226,6 @@ static inline void send_IPI_mask_sequenc
 		}
 	}
 	local_irq_restore(flags);
-}
-
-static inline void send_IPI_mask(int mask, int vector)
-{
-	if (clustered_apic_mode) 
-		send_IPI_mask_sequence(mask, vector);
-	else
-		send_IPI_mask_bitmask(mask, vector);
-}
-
-static inline void send_IPI_allbutself(int vector)
-{
-	/*
-	 * if there are no other CPUs in the system then
-	 * we get an APIC send error if we try to broadcast.
-	 * thus we have to avoid sending IPIs in this case.
-	 */
-	if (!(num_online_cpus() > 1))
-		return;
-
-	if (clustered_apic_mode) {
-		// Pointless. Use send_IPI_mask to do this instead
-		int cpu;
-
-		for (cpu = 0; cpu < NR_CPUS; ++cpu) {
-			if (cpu_online(cpu) && cpu != smp_processor_id())
-				send_IPI_mask(1 << cpu, vector);
-		}
-	} else {
-		__send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
-		return;
-	}
-}
-
-static inline void send_IPI_all(int vector)
-{
-	if (clustered_apic_mode) {
-		// Pointless. Use send_IPI_mask to do this instead
-		int cpu;
-
-		for (cpu = 0; cpu < NR_CPUS; ++cpu) {
-			if (!cpu_online(cpu))
-				continue;
-			send_IPI_mask(1 << cpu, vector);
-		}
-	} else {
-		__send_IPI_shortcut(APIC_DEST_ALLINC, vector);
-	}
 }
 
 /*
diff -urpN -X /home/fletch/.diff.exclude 14-numaq4/include/asm-i386/mach-default/mach_ipi.h 15-numaq5/include/asm-i386/mach-default/mach_ipi.h
--- 14-numaq4/include/asm-i386/mach-default/mach_ipi.h	Wed Dec 31 16:00:00 1969
+++ 15-numaq5/include/asm-i386/mach-default/mach_ipi.h	Sun Dec 22 12:11:09 2002
@@ -0,0 +1,30 @@
+#ifndef __ASM_MACH_IPI_H
+#define __ASM_MACH_IPI_H
+
+static inline void send_IPI_mask_bitmask(int mask, int vector);
+static inline void __send_IPI_shortcut(unsigned int shortcut, int vector);
+
+static inline void send_IPI_mask(int mask, int vector)
+{
+	send_IPI_mask_bitmask(mask, vector);
+}
+
+static inline void send_IPI_allbutself(int vector)
+{
+	/*
+	 * if there are no other CPUs in the system then we get an APIC send 
+	 * error if we try to broadcast, thus avoid sending IPIs in this case.
+	 */
+	if (!(num_online_cpus() > 1))
+		return;
+
+	__send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
+	return;
+}
+
+static inline void send_IPI_all(int vector)
+{
+	__send_IPI_shortcut(APIC_DEST_ALLINC, vector);
+}
+
+#endif /* __ASM_MACH_IPI_H */
diff -urpN -X /home/fletch/.diff.exclude 14-numaq4/include/asm-i386/mach-numaq/mach_ipi.h 15-numaq5/include/asm-i386/mach-numaq/mach_ipi.h
--- 14-numaq4/include/asm-i386/mach-numaq/mach_ipi.h	Wed Dec 31 16:00:00 1969
+++ 15-numaq5/include/asm-i386/mach-numaq/mach_ipi.h	Sun Dec 22 12:11:09 2002
@@ -0,0 +1,39 @@
+#ifndef __ASM_MACH_IPI_H
+#define __ASM_MACH_IPI_H
+
+static inline void send_IPI_mask_sequence(int mask, int vector);
+
+static inline void send_IPI_mask(int mask, int vector)
+{
+	send_IPI_mask_sequence(mask, vector);
+}
+
+static inline void send_IPI_allbutself(int vector)
+{
+	int cpu;
+	/*
+	 * if there are no other CPUs in the system then we get an APIC send 
+	 * error if we try to broadcast, thus avoid sending IPIs in this case.
+	 */
+	if (!(num_online_cpus() > 1))
+		return;
+
+	/* Pointless. Use send_IPI_mask to do this instead */
+	for (cpu = 0; cpu < NR_CPUS; ++cpu)
+		if (cpu_online(cpu) && cpu != smp_processor_id())
+			send_IPI_mask(1 << cpu, vector);
+
+	return;
+}
+
+static inline void send_IPI_all(int vector)
+{
+	int cpu;
+
+	/* Pointless. Use send_IPI_mask to do this instead */
+	for (cpu = 0; cpu < NR_CPUS; ++cpu)
+		if (cpu_online(cpu))
+			send_IPI_mask(1 << cpu, vector);
+}
+
+#endif /* __ASM_MACH_IPI_H */
diff -urpN -X /home/fletch/.diff.exclude 14-numaq4/include/asm-i386/mach-summit/mach_ipi.h 15-numaq5/include/asm-i386/mach-summit/mach_ipi.h
--- 14-numaq4/include/asm-i386/mach-summit/mach_ipi.h	Wed Dec 31 16:00:00 1969
+++ 15-numaq5/include/asm-i386/mach-summit/mach_ipi.h	Sun Dec 22 12:11:09 2002
@@ -0,0 +1,39 @@
+#ifndef __ASM_MACH_IPI_H
+#define __ASM_MACH_IPI_H
+
+static inline void send_IPI_mask_sequence(int mask, int vector);
+
+static inline void send_IPI_mask(int mask, int vector)
+{
+	send_IPI_mask_sequence(mask, vector);
+}
+
+static inline void send_IPI_allbutself(int vector)
+{
+	int cpu;
+	/*
+	 * if there are no other CPUs in the system then we get an APIC send 
+	 * error if we try to broadcast, thus avoid sending IPIs in this case.
+	 */
+	if (!(num_online_cpus() > 1))
+		return;
+
+	/* Pointless. Use send_IPI_mask to do this instead */
+	for (cpu = 0; cpu < NR_CPUS; ++cpu)
+		if (cpu_online(cpu) && cpu != smp_processor_id())
+			send_IPI_mask(1 << cpu, vector);
+
+	return;
+}
+
+static inline void send_IPI_all(int vector)
+{
+	int cpu;
+
+	/* Pointless. Use send_IPI_mask to do this instead */
+	for (cpu = 0; cpu < NR_CPUS; ++cpu)
+		if (cpu_online(cpu))
+			send_IPI_mask(1 << cpu, vector);
+}
+
+#endif /* __ASM_MACH_IPI_H */


                 reply	other threads:[~2002-12-23  6:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=61840000.1040626597@titus \
    --to=mbligh@aracnet.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox