aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux-foundation.org>2009-12-18 17:26:20 -0500
committerPekka Enberg <penberg@cs.helsinki.fi>2009-12-20 02:29:18 -0500
commit9dfc6e68bfe6ee452efb1a4e9ca26a9007f2b864 (patch)
tree40e54f2819e176ceb95b8899265bd48751965c27 /include
parent55639353a0035052d9ea6cfe4dde0ac7fcbb2c9f (diff)
SLUB: Use this_cpu operations in slub
Using per cpu allocations removes the needs for the per cpu arrays in the kmem_cache struct. These could get quite big if we have to support systems with thousands of cpus. The use of this_cpu_xx operations results in: 1. The size of kmem_cache for SMP configuration shrinks since we will only need 1 pointer instead of NR_CPUS. The same pointer can be used by all processors. Reduces cache footprint of the allocator. 2. We can dynamically size kmem_cache according to the actual nodes in the system meaning less memory overhead for configurations that may potentially support up to 1k NUMA nodes / 4k cpus. 3. We can remove the diddle widdle with allocating and releasing of kmem_cache_cpu structures when bringing up and shutting down cpus. The cpu alloc logic will do it all for us. Removes some portions of the cpu hotplug functionality. 4. Fastpath performance increases since per cpu pointer lookups and address calculations are avoided. V7-V8 - Convert missed get_cpu_slab() under CONFIG_SLUB_STATS Signed-off-by: Christoph Lameter <cl@linux-foundation.org> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'include')
-rw-r--r--include/linux/slub_def.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 1e14beb23f9b..17ebe0f89bf3 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -69,6 +69,7 @@ struct kmem_cache_order_objects {
69 * Slab cache management. 69 * Slab cache management.
70 */ 70 */
71struct kmem_cache { 71struct kmem_cache {
72 struct kmem_cache_cpu *cpu_slab;
72 /* Used for retriving partial slabs etc */ 73 /* Used for retriving partial slabs etc */
73 unsigned long flags; 74 unsigned long flags;
74 int size; /* The size of an object including meta data */ 75 int size; /* The size of an object including meta data */
@@ -104,11 +105,6 @@ struct kmem_cache {
104 int remote_node_defrag_ratio; 105 int remote_node_defrag_ratio;
105 struct kmem_cache_node *node[MAX_NUMNODES]; 106 struct kmem_cache_node *node[MAX_NUMNODES];
106#endif 107#endif
107#ifdef CONFIG_SMP
108 struct kmem_cache_cpu *cpu_slab[NR_CPUS];
109#else
110 struct kmem_cache_cpu cpu_slab;
111#endif
112}; 108};
113 109
114/* 110/*