diff options
Diffstat (limited to 'mm/zsmalloc.c')
-rw-r--r-- | mm/zsmalloc.c | 17 |
1 files changed, 14 insertions, 3 deletions
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(); |