diff options
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 41 |
1 files changed, 25 insertions, 16 deletions
@@ -928,12 +928,6 @@ static void next_reap_node(void) | |||
928 | { | 928 | { |
929 | int node = __get_cpu_var(reap_node); | 929 | int node = __get_cpu_var(reap_node); |
930 | 930 | ||
931 | /* | ||
932 | * Also drain per cpu pages on remote zones | ||
933 | */ | ||
934 | if (node != numa_node_id()) | ||
935 | drain_node_pages(node); | ||
936 | |||
937 | node = next_node(node, node_online_map); | 931 | node = next_node(node, node_online_map); |
938 | if (unlikely(node >= MAX_NUMNODES)) | 932 | if (unlikely(node >= MAX_NUMNODES)) |
939 | node = first_node(node_online_map); | 933 | node = first_node(node_online_map); |
@@ -1186,8 +1180,11 @@ static int __cpuinit cpuup_callback(struct notifier_block *nfb, | |||
1186 | int memsize = sizeof(struct kmem_list3); | 1180 | int memsize = sizeof(struct kmem_list3); |
1187 | 1181 | ||
1188 | switch (action) { | 1182 | switch (action) { |
1189 | case CPU_UP_PREPARE: | 1183 | case CPU_LOCK_ACQUIRE: |
1190 | mutex_lock(&cache_chain_mutex); | 1184 | mutex_lock(&cache_chain_mutex); |
1185 | break; | ||
1186 | case CPU_UP_PREPARE: | ||
1187 | case CPU_UP_PREPARE_FROZEN: | ||
1191 | /* | 1188 | /* |
1192 | * We need to do this right in the beginning since | 1189 | * We need to do this right in the beginning since |
1193 | * alloc_arraycache's are going to use this list. | 1190 | * alloc_arraycache's are going to use this list. |
@@ -1274,17 +1271,28 @@ static int __cpuinit cpuup_callback(struct notifier_block *nfb, | |||
1274 | } | 1271 | } |
1275 | break; | 1272 | break; |
1276 | case CPU_ONLINE: | 1273 | case CPU_ONLINE: |
1277 | mutex_unlock(&cache_chain_mutex); | 1274 | case CPU_ONLINE_FROZEN: |
1278 | start_cpu_timer(cpu); | 1275 | start_cpu_timer(cpu); |
1279 | break; | 1276 | break; |
1280 | #ifdef CONFIG_HOTPLUG_CPU | 1277 | #ifdef CONFIG_HOTPLUG_CPU |
1281 | case CPU_DOWN_PREPARE: | 1278 | case CPU_DOWN_PREPARE: |
1282 | mutex_lock(&cache_chain_mutex); | 1279 | case CPU_DOWN_PREPARE_FROZEN: |
1283 | break; | 1280 | /* |
1284 | case CPU_DOWN_FAILED: | 1281 | * Shutdown cache reaper. Note that the cache_chain_mutex is |
1285 | mutex_unlock(&cache_chain_mutex); | 1282 | * held so that if cache_reap() is invoked it cannot do |
1286 | break; | 1283 | * anything expensive but will only modify reap_work |
1284 | * and reschedule the timer. | ||
1285 | */ | ||
1286 | cancel_rearming_delayed_work(&per_cpu(reap_work, cpu)); | ||
1287 | /* Now the cache_reaper is guaranteed to be not running. */ | ||
1288 | per_cpu(reap_work, cpu).work.func = NULL; | ||
1289 | break; | ||
1290 | case CPU_DOWN_FAILED: | ||
1291 | case CPU_DOWN_FAILED_FROZEN: | ||
1292 | start_cpu_timer(cpu); | ||
1293 | break; | ||
1287 | case CPU_DEAD: | 1294 | case CPU_DEAD: |
1295 | case CPU_DEAD_FROZEN: | ||
1288 | /* | 1296 | /* |
1289 | * Even if all the cpus of a node are down, we don't free the | 1297 | * Even if all the cpus of a node are down, we don't free the |
1290 | * kmem_list3 of any cache. This to avoid a race between | 1298 | * kmem_list3 of any cache. This to avoid a race between |
@@ -1296,6 +1304,7 @@ static int __cpuinit cpuup_callback(struct notifier_block *nfb, | |||
1296 | /* fall thru */ | 1304 | /* fall thru */ |
1297 | #endif | 1305 | #endif |
1298 | case CPU_UP_CANCELED: | 1306 | case CPU_UP_CANCELED: |
1307 | case CPU_UP_CANCELED_FROZEN: | ||
1299 | list_for_each_entry(cachep, &cache_chain, next) { | 1308 | list_for_each_entry(cachep, &cache_chain, next) { |
1300 | struct array_cache *nc; | 1309 | struct array_cache *nc; |
1301 | struct array_cache *shared; | 1310 | struct array_cache *shared; |
@@ -1354,6 +1363,8 @@ free_array_cache: | |||
1354 | continue; | 1363 | continue; |
1355 | drain_freelist(cachep, l3, l3->free_objects); | 1364 | drain_freelist(cachep, l3, l3->free_objects); |
1356 | } | 1365 | } |
1366 | break; | ||
1367 | case CPU_LOCK_RELEASE: | ||
1357 | mutex_unlock(&cache_chain_mutex); | 1368 | mutex_unlock(&cache_chain_mutex); |
1358 | break; | 1369 | break; |
1359 | } | 1370 | } |
@@ -3742,7 +3753,6 @@ EXPORT_SYMBOL(__kmalloc); | |||
3742 | 3753 | ||
3743 | /** | 3754 | /** |
3744 | * krealloc - reallocate memory. The contents will remain unchanged. | 3755 | * krealloc - reallocate memory. The contents will remain unchanged. |
3745 | * | ||
3746 | * @p: object to reallocate memory for. | 3756 | * @p: object to reallocate memory for. |
3747 | * @new_size: how many bytes of memory are required. | 3757 | * @new_size: how many bytes of memory are required. |
3748 | * @flags: the type of memory to allocate. | 3758 | * @flags: the type of memory to allocate. |
@@ -4140,7 +4150,6 @@ next: | |||
4140 | check_irq_on(); | 4150 | check_irq_on(); |
4141 | mutex_unlock(&cache_chain_mutex); | 4151 | mutex_unlock(&cache_chain_mutex); |
4142 | next_reap_node(); | 4152 | next_reap_node(); |
4143 | refresh_cpu_vm_stats(smp_processor_id()); | ||
4144 | out: | 4153 | out: |
4145 | /* Set up the next iteration */ | 4154 | /* Set up the next iteration */ |
4146 | schedule_delayed_work(work, round_jiffies_relative(REAPTIMEOUT_CPUC)); | 4155 | schedule_delayed_work(work, round_jiffies_relative(REAPTIMEOUT_CPUC)); |