diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-02-03 18:45:06 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2004-02-03 18:45:06 -0800 |
| commit | 4c5736de7785f499aad01c87b568011aebc8ebf4 (patch) | |
| tree | 5466ac60afd5d5981ab219241133b99b36d24773 /include | |
| parent | b5a2bdf93c878d8c6bd3172cf75d1662236684da (diff) | |
[PATCH] Remove memblks from the kernel
From: "Martin J. Bligh" <mbligh@aracnet.com>
This patch removes memblks from the kernel ... we don't use them, and the
NUMA API that was planning to use them when they were originally designed
isn't going to use them anymore. They're just unnecessary added complexity
now ... time for them to go.
There's a slight complication in that ia64 uses something with a similar
name for part of its memory layout, but Jes Sorensen kindly untangled them
from each other for us. The patch with his modifications is below. Jes
tested it on ia64, and I testbuilt it with every config in my arsenal.
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-alpha/topology.h | 3 | ||||
| -rw-r--r-- | include/asm-generic/topology.h | 6 | ||||
| -rw-r--r-- | include/asm-i386/memblk.h | 23 | ||||
| -rw-r--r-- | include/asm-i386/topology.h | 6 | ||||
| -rw-r--r-- | include/asm-ia64/mmzone.h | 6 | ||||
| -rw-r--r-- | include/asm-ia64/numa.h | 4 | ||||
| -rw-r--r-- | include/asm-ia64/topology.h | 15 | ||||
| -rw-r--r-- | include/asm-ppc64/topology.h | 4 | ||||
| -rw-r--r-- | include/asm-x86_64/memblk.h | 1 | ||||
| -rw-r--r-- | include/asm-x86_64/topology.h | 2 | ||||
| -rw-r--r-- | include/linux/memblk.h | 32 | ||||
| -rw-r--r-- | include/linux/mmzone.h | 29 |
12 files changed, 5 insertions, 126 deletions
diff --git a/include/asm-alpha/topology.h b/include/asm-alpha/topology.h index dbdb0d4f90e1..65a6a2e8b6a1 100644 --- a/include/asm-alpha/topology.h +++ b/include/asm-alpha/topology.h @@ -39,9 +39,6 @@ static inline int node_to_cpumask(int node) return node_cpu_mask; } -# define node_to_memblk(node) (node) -# define memblk_to_node(memblk) (memblk) - /* Cross-node load balancing interval. */ # define NODE_BALANCE_RATE 10 diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h index ba29df93e8eb..8f84159f0f4b 100644 --- a/include/asm-generic/topology.h +++ b/include/asm-generic/topology.h @@ -32,9 +32,6 @@ #ifndef cpu_to_node #define cpu_to_node(cpu) (0) #endif -#ifndef memblk_to_node -#define memblk_to_node(memblk) (0) -#endif #ifndef parent_node #define parent_node(node) (0) #endif @@ -44,9 +41,6 @@ #ifndef node_to_first_cpu #define node_to_first_cpu(node) (0) #endif -#ifndef node_to_memblk -#define node_to_memblk(node) (0) -#endif #ifndef pcibus_to_cpumask #define pcibus_to_cpumask(bus) (cpu_online_map) #endif diff --git a/include/asm-i386/memblk.h b/include/asm-i386/memblk.h deleted file mode 100644 index 668fc0d644ba..000000000000 --- a/include/asm-i386/memblk.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef _ASM_I386_MEMBLK_H_ -#define _ASM_I386_MEMBLK_H_ - -#include <linux/device.h> -#include <linux/mmzone.h> -#include <linux/memblk.h> -#include <linux/topology.h> - -#include <asm/node.h> - -struct i386_memblk { - struct memblk memblk; -}; -extern struct i386_memblk memblk_devices[MAX_NR_MEMBLKS]; - -static inline int arch_register_memblk(int num){ - int p_node = memblk_to_node(num); - - return register_memblk(&memblk_devices[num].memblk, num, - &node_devices[p_node].node); -} - -#endif /* _ASM_I386_MEMBLK_H_ */ diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h index 9190a4f3408f..219c6efbd972 100644 --- a/include/asm-i386/topology.h +++ b/include/asm-i386/topology.h @@ -43,9 +43,6 @@ static inline int cpu_to_node(int cpu) return cpu_2_node[cpu]; } -/* Returns the number of the node containing MemBlk 'memblk' */ -#define memblk_to_node(memblk) (memblk) - /* Returns the number of the node containing Node 'node'. This architecture is flat, so it is a pretty simple function! */ #define parent_node(node) (node) @@ -63,9 +60,6 @@ static inline int node_to_first_cpu(int node) return first_cpu(mask); } -/* Returns the number of the first MemBlk on Node 'node' */ -#define node_to_memblk(node) (node) - /* Returns the number of the node containing PCI bus 'bus' */ static inline cpumask_t pcibus_to_cpumask(int bus) { diff --git a/include/asm-ia64/mmzone.h b/include/asm-ia64/mmzone.h index 9b9afd467f76..f28f0b28504f 100644 --- a/include/asm-ia64/mmzone.h +++ b/include/asm-ia64/mmzone.h @@ -20,11 +20,11 @@ #ifdef CONFIG_IA64_DIG /* DIG systems are small */ # define MAX_PHYSNODE_ID 8 # define NR_NODES 8 -# define NR_MEMBLKS (NR_NODES * 32) +# define NR_NODE_MEMBLKS (NR_NODES * 8) #else /* sn2 is the biggest case, so we use that if !DIG */ # define MAX_PHYSNODE_ID 2048 # define NR_NODES 256 -# define NR_MEMBLKS (NR_NODES) +# define NR_NODE_MEMBLKS (NR_NODES * 4) #endif extern unsigned long max_low_pfn; @@ -34,6 +34,6 @@ extern unsigned long max_low_pfn; #define pfn_to_page(pfn) (vmem_map + (pfn)) #else /* CONFIG_DISCONTIGMEM */ -# define NR_MEMBLKS 1 +# define NR_NODE_MEMBLKS 4 #endif /* CONFIG_DISCONTIGMEM */ #endif /* _ASM_IA64_MMZONE_H */ diff --git a/include/asm-ia64/numa.h b/include/asm-ia64/numa.h index de73c7000a52..6459f619a497 100644 --- a/include/asm-ia64/numa.h +++ b/include/asm-ia64/numa.h @@ -28,7 +28,7 @@ extern cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned; /* Stuff below this line could be architecture independent */ -extern int num_memblks; /* total number of memory chunks */ +extern int num_node_memblks; /* total number of memory chunks */ /* * List of node memory chunks. Filled when parsing SRAT table to @@ -47,7 +47,7 @@ struct node_cpuid_s { int nid; /* logical node containing this CPU */ }; -extern struct node_memblk_s node_memblk[NR_MEMBLKS]; +extern struct node_memblk_s node_memblk[NR_NODE_MEMBLKS]; extern struct node_cpuid_s node_cpuid[NR_CPUS]; /* diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h index f6b971b5267c..d4105bd76489 100644 --- a/include/asm-ia64/topology.h +++ b/include/asm-ia64/topology.h @@ -29,15 +29,6 @@ #define node_to_cpumask(node) (node_to_cpu_mask[node]) /* - * Returns the number of the node containing MemBlk 'memblk' - */ -#ifdef CONFIG_ACPI_NUMA -#define memblk_to_node(memblk) (node_memblk[memblk].nid) -#else -#define memblk_to_node(memblk) (memblk) -#endif - -/* * Returns the number of the node containing Node 'nid'. * Not implemented here. Multi-level hierarchies detected with * the help of node_distance(). @@ -49,12 +40,6 @@ */ #define node_to_first_cpu(node) (__ffs(node_to_cpumask(node))) -/* - * Returns the number of the first MemBlk on Node 'node' - * Should be fixed when IA64 discontigmem goes in. - */ -#define node_to_memblk(node) (node) - /* Cross-node load balancing interval. */ #define NODE_BALANCE_RATE 10 diff --git a/include/asm-ppc64/topology.h b/include/asm-ppc64/topology.h index a41ca6cba882..c6846ecfaf8b 100644 --- a/include/asm-ppc64/topology.h +++ b/include/asm-ppc64/topology.h @@ -19,8 +19,6 @@ static inline int cpu_to_node(int cpu) return node; } -#define memblk_to_node(memblk) (memblk) - #define parent_node(node) (node) static inline cpumask_t node_to_cpumask(int node) @@ -35,8 +33,6 @@ static inline int node_to_first_cpu(int node) return first_cpu(tmp); } -#define node_to_memblk(node) (node) - #define pcibus_to_cpumask(bus) (cpu_online_map) #define nr_cpus_node(node) (nr_cpus_in_node[node]) diff --git a/include/asm-x86_64/memblk.h b/include/asm-x86_64/memblk.h deleted file mode 100644 index cb084c244f0d..000000000000 --- a/include/asm-x86_64/memblk.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/memblk.h> diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h index 1a614e8c0b18..02b24f4ef8d9 100644 --- a/include/asm-x86_64/topology.h +++ b/include/asm-x86_64/topology.h @@ -15,11 +15,9 @@ extern int fake_node; extern unsigned long cpu_online_map; #define cpu_to_node(cpu) (fake_node ? 0 : (cpu)) -#define memblk_to_node(memblk) (fake_node ? 0 : (memblk)) #define parent_node(node) (node) #define node_to_first_cpu(node) (fake_node ? 0 : (node)) #define node_to_cpumask(node) (fake_node ? cpu_online_map : (1UL << (node))) -#define node_to_memblk(node) (node) static inline unsigned long pcibus_to_cpumask(int bus) { diff --git a/include/linux/memblk.h b/include/linux/memblk.h deleted file mode 100644 index 5f216fb47907..000000000000 --- a/include/linux/memblk.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * include/linux/memblk.h - generic memblk definition - * - * This is mainly for topological representation. We define the - * basic 'struct memblk' here, which can be embedded in per-arch - * definitions of memory blocks. - * - * Basic handling of the devices is done in drivers/base/memblk.c - * and system devices are handled in drivers/base/sys.c. - * - * MemBlks are exported via driverfs in the class/memblk/devices/ - * directory. - * - * Per-memblk interfaces can be implemented using a struct device_interface. - * See the following for how to do this: - * - drivers/base/intf.c - * - Documentation/driver-model/interface.txt - */ -#ifndef _LINUX_MEMBLK_H_ -#define _LINUX_MEMBLK_H_ - -#include <linux/device.h> -#include <linux/node.h> - -struct memblk { - int node_id; /* The node which contains the MemBlk */ - struct sys_device sysdev; -}; - -extern int register_memblk(struct memblk *, int, struct node *); - -#endif /* _LINUX_MEMBLK_H_ */ diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 71f2f39cae0f..179f51f29f78 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -294,12 +294,6 @@ struct file; int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, void *, size_t *); -#ifdef CONFIG_NUMA -#define MAX_NR_MEMBLKS BITS_PER_LONG /* Max number of Memory Blocks */ -#else /* !CONFIG_NUMA */ -#define MAX_NR_MEMBLKS 1 -#endif /* CONFIG_NUMA */ - #include <linux/topology.h> /* Returns the number of the current Node. */ #define numa_node_id() (cpu_to_node(smp_processor_id())) @@ -342,7 +336,6 @@ extern struct pglist_data contig_page_data; #endif extern DECLARE_BITMAP(node_online_map, MAX_NUMNODES); -extern DECLARE_BITMAP(memblk_online_map, MAX_NR_MEMBLKS); #if defined(CONFIG_DISCONTIGMEM) || defined(CONFIG_NUMA) @@ -360,20 +353,6 @@ static inline unsigned int num_online_nodes(void) return num; } -#define memblk_online(memblk) test_bit(memblk, memblk_online_map) -#define memblk_set_online(memblk) set_bit(memblk, memblk_online_map) -#define memblk_set_offline(memblk) clear_bit(memblk, memblk_online_map) -static inline unsigned int num_online_memblks(void) -{ - int i, num = 0; - - for(i = 0; i < MAX_NR_MEMBLKS; i++){ - if (memblk_online(i)) - num++; - } - return num; -} - #else /* !CONFIG_DISCONTIGMEM && !CONFIG_NUMA */ #define node_online(node) \ @@ -384,14 +363,6 @@ static inline unsigned int num_online_memblks(void) ({ BUG_ON((node) != 0); clear_bit(node, node_online_map); }) #define num_online_nodes() 1 -#define memblk_online(memblk) \ - ({ BUG_ON((memblk) != 0); test_bit(memblk, memblk_online_map); }) -#define memblk_set_online(memblk) \ - ({ BUG_ON((memblk) != 0); set_bit(memblk, memblk_online_map); }) -#define memblk_set_offline(memblk) \ - ({ BUG_ON((memblk) != 0); clear_bit(memblk, memblk_online_map); }) -#define num_online_memblks() 1 - #endif /* CONFIG_DISCONTIGMEM || CONFIG_NUMA */ #endif /* !__ASSEMBLY__ */ #endif /* __KERNEL__ */ |
