All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Dobson <colpatch@us.ibm.com>
To: Andrew Morton <akpm@zip.com.au>
Cc: Anton Blanchard <anton@samba.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [patch] linux-2.5.38-mm2 cleanups
Date: Tue, 24 Sep 2002 15:13:48 -0700	[thread overview]
Message-ID: <3D90E39C.5020107@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

Andrew,
	Here are a couple of cleanups for the 2.5.38-mm2 tree.

Anton,
	I cc'd you, because the patch also moves the __cpu_to_node() function 
from mmzone.h into topology.h, where it really belongs (as long as the 
in-kernel topology stuff is there).  If there's some reason that 
shouldn't be done, please yell at me! ;)

Changelog:
	This patch cleans up a couple of braindamaged things I was doing with 
<asm-generic/topology.h> and moves a ppc64 topology function from 
mmzone.h into topology.h.

Cheers!

-Matt

[-- Attachment #2: 2.5.38-mm2_fixup.patch --]
[-- Type: text/plain, Size: 5512 bytes --]

diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.38-mm2/include/asm-alpha/topology.h linux-2.5.38-mm2_fixes/include/asm-alpha/topology.h
--- linux-2.5.38-mm2/include/asm-alpha/topology.h	Tue Sep 24 10:41:22 2002
+++ linux-2.5.38-mm2_fixes/include/asm-alpha/topology.h	Tue Sep 24 11:16:59 2002
@@ -4,11 +4,18 @@
 #ifdef CONFIG_NUMA
 #ifdef CONFIG_ALPHA_WILDFIRE
 /* With wildfire assume 4 CPUs per node */
-#define __cpu_to_node(cpu)	((cpu) >> 2)
+#define __cpu_to_node(cpu)		((cpu) >> 2)
 #endif /* CONFIG_ALPHA_WILDFIRE */
 #endif /* CONFIG_NUMA */
 
-/* Get the rest of the topology definitions */
-#include <asm-generic/topology.h>
+#if !defined(CONFIG_NUMA) || !defined(CONFIG_ALPHA_WILDFIRE)
+#define __cpu_to_node(cpu)		(0)
+#endif /* !CONFIG_NUMA || !CONFIG_ALPHA_WILDFIRE */
+
+#define __memblk_to_node(memblk)	(0)
+#define __parent_node(nid)		(0)
+#define __node_to_first_cpu(node)	(0)
+#define __node_to_cpu_mask(node)	(cpu_online_map)
+#define __node_to_memblk(node)		(0)
 
 #endif /* _ASM_ALPHA_TOPOLOGY_H */
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.38-mm2/include/asm-generic/topology.h linux-2.5.38-mm2_fixes/include/asm-generic/topology.h
--- linux-2.5.38-mm2/include/asm-generic/topology.h	Tue Sep 24 10:41:22 2002
+++ linux-2.5.38-mm2_fixes/include/asm-generic/topology.h	Tue Sep 24 11:00:30 2002
@@ -33,7 +33,7 @@
 #define __cpu_to_node(cpu)		(0)
 #endif
 #ifndef __memblk_to_node
-#define __memblk_to_node(memblk)		(0)
+#define __memblk_to_node(memblk)	(0)
 #endif
 #ifndef __parent_node
 #define __parent_node(nid)		(0)
@@ -42,7 +42,7 @@
 #define __node_to_first_cpu(node)	(0)
 #endif
 #ifndef __node_to_cpu_mask
-#define __node_to_cpu_mask(node)		(cpu_online_map)
+#define __node_to_cpu_mask(node)	(cpu_online_map)
 #endif
 #ifndef __node_to_memblk
 #define __node_to_memblk(node)		(0)
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.38-mm2/include/asm-i386/mmzone.h linux-2.5.38-mm2_fixes/include/asm-i386/mmzone.h
--- linux-2.5.38-mm2/include/asm-i386/mmzone.h	Tue Sep 24 10:41:22 2002
+++ linux-2.5.38-mm2_fixes/include/asm-i386/mmzone.h	Tue Sep 24 10:51:30 2002
@@ -14,9 +14,6 @@
 #include <asm/numaq.h>
 #else
 #define pfn_to_nid(pfn)		(0)
-#ifdef CONFIG_NUMA
-#define _cpu_to_node(cpu) 0
-#endif /* CONFIG_NUMA */
 #endif /* CONFIG_X86_NUMAQ */
 
 extern struct pglist_data *node_data[];
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.38-mm2/include/asm-i386/numaq.h linux-2.5.38-mm2_fixes/include/asm-i386/numaq.h
--- linux-2.5.38-mm2/include/asm-i386/numaq.h	Sat Sep 21 21:25:11 2002
+++ linux-2.5.38-mm2_fixes/include/asm-i386/numaq.h	Tue Sep 24 10:52:09 2002
@@ -41,9 +41,6 @@
 #define pfn_to_pgdat(pfn) NODE_DATA(pfn_to_nid(pfn))
 #define PHYSADDR_TO_NID(pa) pfn_to_nid(pa >> PAGE_SHIFT)
 #define MAX_NUMNODES		8
-#ifdef CONFIG_NUMA
-#define _cpu_to_node(cpu) (cpu_to_logical_apicid(cpu) >> 4)
-#endif /* CONFIG_NUMA */
 extern int pfn_to_nid(unsigned long);
 extern void get_memcfg_numaq(void);
 #define get_memcfg_numa() get_memcfg_numaq()
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.38-mm2/include/asm-mips64/topology.h linux-2.5.38-mm2_fixes/include/asm-mips64/topology.h
--- linux-2.5.38-mm2/include/asm-mips64/topology.h	Tue Sep 24 10:41:22 2002
+++ linux-2.5.38-mm2_fixes/include/asm-mips64/topology.h	Tue Sep 24 11:09:57 2002
@@ -4,8 +4,10 @@
 #include <asm/mmzone.h>
 
 #define __cpu_to_node(cpu)		(cputocnode(cpu))
-
-/* Get the rest of the topology definitions */
-#include <asm-generic/topology.h>
+#define __memblk_to_node(memblk)	(0)
+#define __parent_node(nid)		(0)
+#define __node_to_first_cpu(node)	(0)
+#define __node_to_cpu_mask(node)	(cpu_online_map)
+#define __node_to_memblk(node)		(0)
 
 #endif /* _ASM_MIPS64_TOPOLOGY_H */
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.38-mm2/include/asm-ppc64/mmzone.h linux-2.5.38-mm2_fixes/include/asm-ppc64/mmzone.h
--- linux-2.5.38-mm2/include/asm-ppc64/mmzone.h	Tue Sep 24 10:41:22 2002
+++ linux-2.5.38-mm2_fixes/include/asm-ppc64/mmzone.h	Tue Sep 24 10:50:56 2002
@@ -56,24 +56,6 @@
 #define node_size(nid)		(NODE_DATA(nid)->node_size)
 #define node_localnr(pfn, nid)	((pfn) - NODE_DATA(nid)->node_start_pfn)
 
-#ifdef CONFIG_NUMA
-
-static inline int __cpu_to_node(int cpu)
-{
-	int node;
-
-	node = numa_cpu_lookup_table[cpu];
-
-#ifdef DEBUG_NUMA
-	if (node == -1)
-		BUG();
-#endif
-
-	return node;
-}
-
-#endif /* CONFIG_NUMA */
-
 /*
  * Following are macros that each numa implmentation must define.
  */
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.38-mm2/include/asm-ppc64/topology.h linux-2.5.38-mm2_fixes/include/asm-ppc64/topology.h
--- linux-2.5.38-mm2/include/asm-ppc64/topology.h	Tue Sep 24 10:41:22 2002
+++ linux-2.5.38-mm2_fixes/include/asm-ppc64/topology.h	Tue Sep 24 11:18:15 2002
@@ -4,11 +4,31 @@
 #include <asm/mmzone.h>
 
 #ifdef CONFIG_NUMA
-/* XXX grab this from the device tree - Anton */
-#define __cpu_to_node(cpu)	((cpu) >> CPU_SHIFT_BITS)
+
+static inline int __cpu_to_node(int cpu)
+{
+	int node;
+
+	node = numa_cpu_lookup_table[cpu];
+
+#ifdef DEBUG_NUMA
+	if (node == -1)
+		BUG();
+#endif
+
+	return node;
+}
+
+#else /* !CONFIG_NUMA */
+
+#define __cpu_to_node(cpu)		(0)
+
 #endif /* CONFIG_NUMA */
 
-/* Get the rest of the topology definitions */
-#include <asm-generic/topology.h>
+#define __memblk_to_node(memblk)	(0)
+#define __parent_node(nid)		(0)
+#define __node_to_first_cpu(node)	(0)
+#define __node_to_cpu_mask(node)	(cpu_online_map)
+#define __node_to_memblk(node)		(0)
 
 #endif /* _ASM_PPC64_TOPOLOGY_H */

             reply	other threads:[~2002-09-24 22:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-24 22:13 Matthew Dobson [this message]
2002-09-25 13:26 ` [patch] linux-2.5.38-mm2 cleanups Anton Blanchard
2002-09-25 13:26   ` Anton Blanchard

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=3D90E39C.5020107@us.ibm.com \
    --to=colpatch@us.ibm.com \
    --cc=akpm@zip.com.au \
    --cc=anton@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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.