diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-24 15:47:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-24 15:47:55 -0400 |
commit | 76c39e4fef73e42777c27d6b87a04f89ebd0ef66 (patch) | |
tree | 40f490c46a409bfe4cecd99cf08ad709065d116b /include | |
parent | 1765a1fe5d6f82c0eceb1ad10594cfc83759b6d0 (diff) | |
parent | 6d4121f6c20a0e86231d52f535f1c82423b3326f (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6: (27 commits)
SLUB: Fix memory hotplug with !NUMA
slub: Move functions to reduce #ifdefs
slub: Enable sysfs support for !CONFIG_SLUB_DEBUG
SLUB: Optimize slab_free() debug check
slub: Move NUMA-related functions under CONFIG_NUMA
slub: Add lock release annotation
slub: Fix signedness warnings
slub: extract common code to remove objects from partial list without locking
SLUB: Pass active and inactive redzone flags instead of boolean to debug functions
slub: reduce differences between SMP and NUMA
Revert "Slub: UP bandaid"
percpu: clear memory allocated with the km allocator
percpu: use percpu allocator on UP too
percpu: reduce PCPU_MIN_UNIT_SIZE to 32k
vmalloc: pcpu_get/free_vm_areas() aren't needed on UP
SLUB: Fix merged slab cache names
Slub: UP bandaid
slub: fix SLUB_RESILIENCY_TEST for dynamic kmalloc caches
slub: Fix up missing kmalloc_cache -> kmem_cache_node case for memoryhotplug
slub: Add dummy functions for the !SLUB_DEBUG case
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/slub_def.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 9f63538928c0..e4f5ed180b9b 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -87,7 +87,7 @@ struct kmem_cache { | |||
87 | unsigned long min_partial; | 87 | unsigned long min_partial; |
88 | const char *name; /* Name (only for display!) */ | 88 | const char *name; /* Name (only for display!) */ |
89 | struct list_head list; /* List of slab caches */ | 89 | struct list_head list; /* List of slab caches */ |
90 | #ifdef CONFIG_SLUB_DEBUG | 90 | #ifdef CONFIG_SYSFS |
91 | struct kobject kobj; /* For sysfs */ | 91 | struct kobject kobj; /* For sysfs */ |
92 | #endif | 92 | #endif |
93 | 93 | ||
@@ -96,11 +96,8 @@ struct kmem_cache { | |||
96 | * Defragmentation by allocating from a remote node. | 96 | * Defragmentation by allocating from a remote node. |
97 | */ | 97 | */ |
98 | int remote_node_defrag_ratio; | 98 | int remote_node_defrag_ratio; |
99 | struct kmem_cache_node *node[MAX_NUMNODES]; | ||
100 | #else | ||
101 | /* Avoid an extra cache line for UP */ | ||
102 | struct kmem_cache_node local_node; | ||
103 | #endif | 99 | #endif |
100 | struct kmem_cache_node *node[MAX_NUMNODES]; | ||
104 | }; | 101 | }; |
105 | 102 | ||
106 | /* | 103 | /* |
@@ -139,19 +136,16 @@ struct kmem_cache { | |||
139 | 136 | ||
140 | #ifdef CONFIG_ZONE_DMA | 137 | #ifdef CONFIG_ZONE_DMA |
141 | #define SLUB_DMA __GFP_DMA | 138 | #define SLUB_DMA __GFP_DMA |
142 | /* Reserve extra caches for potential DMA use */ | ||
143 | #define KMALLOC_CACHES (2 * SLUB_PAGE_SHIFT) | ||
144 | #else | 139 | #else |
145 | /* Disable DMA functionality */ | 140 | /* Disable DMA functionality */ |
146 | #define SLUB_DMA (__force gfp_t)0 | 141 | #define SLUB_DMA (__force gfp_t)0 |
147 | #define KMALLOC_CACHES SLUB_PAGE_SHIFT | ||
148 | #endif | 142 | #endif |
149 | 143 | ||
150 | /* | 144 | /* |
151 | * We keep the general caches in an array of slab caches that are used for | 145 | * We keep the general caches in an array of slab caches that are used for |
152 | * 2^x bytes of allocations. | 146 | * 2^x bytes of allocations. |
153 | */ | 147 | */ |
154 | extern struct kmem_cache kmalloc_caches[KMALLOC_CACHES]; | 148 | extern struct kmem_cache *kmalloc_caches[SLUB_PAGE_SHIFT]; |
155 | 149 | ||
156 | /* | 150 | /* |
157 | * Sorry that the following has to be that ugly but some versions of GCC | 151 | * Sorry that the following has to be that ugly but some versions of GCC |
@@ -216,7 +210,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size) | |||
216 | if (index == 0) | 210 | if (index == 0) |
217 | return NULL; | 211 | return NULL; |
218 | 212 | ||
219 | return &kmalloc_caches[index]; | 213 | return kmalloc_caches[index]; |
220 | } | 214 | } |
221 | 215 | ||
222 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | 216 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); |