Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm/slub.c: use register_hotmemory_notifier()

Squishes a statement-with-no-effect warning, removes some ifdefs and
shrinks .text by 2 bytes.

Note that this code fails to check for blocking_notifier_chain_register()
failures.

Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrew Morton and committed by
Linus Torvalds
3ac38faa 8f68fa2d

+6 -3
+6 -3
mm/slub.c
··· 18 18 #include <linux/slab.h> 19 19 #include "slab.h" 20 20 #include <linux/proc_fs.h> 21 + #include <linux/notifier.h> 21 22 #include <linux/seq_file.h> 22 23 #include <linux/kmemcheck.h> 23 24 #include <linux/cpu.h> ··· 3484 3483 } 3485 3484 EXPORT_SYMBOL(kmem_cache_shrink); 3486 3485 3487 - #if defined(CONFIG_MEMORY_HOTPLUG) 3488 3486 static int slab_mem_going_offline_callback(void *arg) 3489 3487 { 3490 3488 struct kmem_cache *s; ··· 3598 3598 return ret; 3599 3599 } 3600 3600 3601 - #endif /* CONFIG_MEMORY_HOTPLUG */ 3601 + static struct notifier_block slab_memory_callback_nb = { 3602 + .notifier_call = slab_memory_callback, 3603 + .priority = SLAB_CALLBACK_PRI, 3604 + }; 3602 3605 3603 3606 /******************************************************************** 3604 3607 * Basic setup of slabs ··· 3654 3651 create_boot_cache(kmem_cache_node, "kmem_cache_node", 3655 3652 sizeof(struct kmem_cache_node), SLAB_HWCACHE_ALIGN); 3656 3653 3657 - hotplug_memory_notifier(slab_memory_callback, SLAB_CALLBACK_PRI); 3654 + register_hotmemory_notifier(&slab_memory_callback_nb); 3658 3655 3659 3656 /* Able to allocate the per node structures */ 3660 3657 slab_state = PARTIAL;