diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/vmstat.c | 6 | ||||
-rw-r--r-- | mm/zsmalloc.c | 17 | ||||
-rw-r--r-- | mm/zswap.c | 8 |
3 files changed, 21 insertions, 10 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c index 197b4c4a9587..302dd076b8bf 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
@@ -1298,14 +1298,14 @@ static int __init setup_vmstat(void) | |||
1298 | #ifdef CONFIG_SMP | 1298 | #ifdef CONFIG_SMP |
1299 | int cpu; | 1299 | int cpu; |
1300 | 1300 | ||
1301 | register_cpu_notifier(&vmstat_notifier); | 1301 | cpu_notifier_register_begin(); |
1302 | __register_cpu_notifier(&vmstat_notifier); | ||
1302 | 1303 | ||
1303 | get_online_cpus(); | ||
1304 | for_each_online_cpu(cpu) { | 1304 | for_each_online_cpu(cpu) { |
1305 | start_cpu_timer(cpu); | 1305 | start_cpu_timer(cpu); |
1306 | node_set_state(cpu_to_node(cpu), N_CPU); | 1306 | node_set_state(cpu_to_node(cpu), N_CPU); |
1307 | } | 1307 | } |
1308 | put_online_cpus(); | 1308 | cpu_notifier_register_done(); |
1309 | #endif | 1309 | #endif |
1310 | #ifdef CONFIG_PROC_FS | 1310 | #ifdef CONFIG_PROC_FS |
1311 | proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations); | 1311 | proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations); |
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index c03ca5e9fe15..36b4591a7a2d 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c | |||
@@ -814,21 +814,32 @@ static void zs_exit(void) | |||
814 | { | 814 | { |
815 | int cpu; | 815 | int cpu; |
816 | 816 | ||
817 | cpu_notifier_register_begin(); | ||
818 | |||
817 | for_each_online_cpu(cpu) | 819 | for_each_online_cpu(cpu) |
818 | zs_cpu_notifier(NULL, CPU_DEAD, (void *)(long)cpu); | 820 | zs_cpu_notifier(NULL, CPU_DEAD, (void *)(long)cpu); |
819 | unregister_cpu_notifier(&zs_cpu_nb); | 821 | __unregister_cpu_notifier(&zs_cpu_nb); |
822 | |||
823 | cpu_notifier_register_done(); | ||
820 | } | 824 | } |
821 | 825 | ||
822 | static int zs_init(void) | 826 | static int zs_init(void) |
823 | { | 827 | { |
824 | int cpu, ret; | 828 | int cpu, ret; |
825 | 829 | ||
826 | register_cpu_notifier(&zs_cpu_nb); | 830 | cpu_notifier_register_begin(); |
831 | |||
832 | __register_cpu_notifier(&zs_cpu_nb); | ||
827 | for_each_online_cpu(cpu) { | 833 | for_each_online_cpu(cpu) { |
828 | ret = zs_cpu_notifier(NULL, CPU_UP_PREPARE, (void *)(long)cpu); | 834 | ret = zs_cpu_notifier(NULL, CPU_UP_PREPARE, (void *)(long)cpu); |
829 | if (notifier_to_errno(ret)) | 835 | if (notifier_to_errno(ret)) { |
836 | cpu_notifier_register_done(); | ||
830 | goto fail; | 837 | goto fail; |
838 | } | ||
831 | } | 839 | } |
840 | |||
841 | cpu_notifier_register_done(); | ||
842 | |||
832 | return 0; | 843 | return 0; |
833 | fail: | 844 | fail: |
834 | zs_exit(); | 845 | zs_exit(); |
diff --git a/mm/zswap.c b/mm/zswap.c index 34b75cc70827..aeaef0fb5624 100644 --- a/mm/zswap.c +++ b/mm/zswap.c | |||
@@ -388,18 +388,18 @@ static int zswap_cpu_init(void) | |||
388 | { | 388 | { |
389 | unsigned long cpu; | 389 | unsigned long cpu; |
390 | 390 | ||
391 | get_online_cpus(); | 391 | cpu_notifier_register_begin(); |
392 | for_each_online_cpu(cpu) | 392 | for_each_online_cpu(cpu) |
393 | if (__zswap_cpu_notifier(CPU_UP_PREPARE, cpu) != NOTIFY_OK) | 393 | if (__zswap_cpu_notifier(CPU_UP_PREPARE, cpu) != NOTIFY_OK) |
394 | goto cleanup; | 394 | goto cleanup; |
395 | register_cpu_notifier(&zswap_cpu_notifier_block); | 395 | __register_cpu_notifier(&zswap_cpu_notifier_block); |
396 | put_online_cpus(); | 396 | cpu_notifier_register_done(); |
397 | return 0; | 397 | return 0; |
398 | 398 | ||
399 | cleanup: | 399 | cleanup: |
400 | for_each_online_cpu(cpu) | 400 | for_each_online_cpu(cpu) |
401 | __zswap_cpu_notifier(CPU_UP_CANCELED, cpu); | 401 | __zswap_cpu_notifier(CPU_UP_CANCELED, cpu); |
402 | put_online_cpus(); | 402 | cpu_notifier_register_done(); |
403 | return -ENOMEM; | 403 | return -ENOMEM; |
404 | } | 404 | } |
405 | 405 | ||