diff options
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1124,6 +1124,7 @@ void __init kmem_cache_init(void) | |||
1124 | struct cache_sizes *sizes; | 1124 | struct cache_sizes *sizes; |
1125 | struct cache_names *names; | 1125 | struct cache_names *names; |
1126 | int i; | 1126 | int i; |
1127 | int order; | ||
1127 | 1128 | ||
1128 | for (i = 0; i < NUM_INIT_LISTS; i++) { | 1129 | for (i = 0; i < NUM_INIT_LISTS; i++) { |
1129 | kmem_list3_init(&initkmem_list3[i]); | 1130 | kmem_list3_init(&initkmem_list3[i]); |
@@ -1167,11 +1168,15 @@ void __init kmem_cache_init(void) | |||
1167 | 1168 | ||
1168 | cache_cache.buffer_size = ALIGN(cache_cache.buffer_size, cache_line_size()); | 1169 | cache_cache.buffer_size = ALIGN(cache_cache.buffer_size, cache_line_size()); |
1169 | 1170 | ||
1170 | cache_estimate(0, cache_cache.buffer_size, cache_line_size(), 0, | 1171 | for (order = 0; order < MAX_ORDER; order++) { |
1171 | &left_over, &cache_cache.num); | 1172 | cache_estimate(order, cache_cache.buffer_size, |
1173 | cache_line_size(), 0, &left_over, &cache_cache.num); | ||
1174 | if (cache_cache.num) | ||
1175 | break; | ||
1176 | } | ||
1172 | if (!cache_cache.num) | 1177 | if (!cache_cache.num) |
1173 | BUG(); | 1178 | BUG(); |
1174 | 1179 | cache_cache.gfporder = order; | |
1175 | cache_cache.colour = left_over / cache_cache.colour_off; | 1180 | cache_cache.colour = left_over / cache_cache.colour_off; |
1176 | cache_cache.slab_size = ALIGN(cache_cache.num * sizeof(kmem_bufctl_t) + | 1181 | cache_cache.slab_size = ALIGN(cache_cache.num * sizeof(kmem_bufctl_t) + |
1177 | sizeof(struct slab), cache_line_size()); | 1182 | sizeof(struct slab), cache_line_size()); |