diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2013-04-29 18:08:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 18:54:36 -0400 |
commit | 3ac38faa1f09d7eb01497eb50eb83e4f2d132667 (patch) | |
tree | 4b9d0937ba6e02600b22e94b72e57288c7ed1284 | |
parent | 8f68fa2d1908365cb372b1aebf89d6af4b2b3871 (diff) |
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>
-rw-r--r-- | mm/slub.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include "slab.h" | 19 | #include "slab.h" |
20 | #include <linux/proc_fs.h> | 20 | #include <linux/proc_fs.h> |
21 | #include <linux/notifier.h> | ||
21 | #include <linux/seq_file.h> | 22 | #include <linux/seq_file.h> |
22 | #include <linux/kmemcheck.h> | 23 | #include <linux/kmemcheck.h> |
23 | #include <linux/cpu.h> | 24 | #include <linux/cpu.h> |
@@ -3483,7 +3484,6 @@ int kmem_cache_shrink(struct kmem_cache *s) | |||
3483 | } | 3484 | } |
3484 | EXPORT_SYMBOL(kmem_cache_shrink); | 3485 | EXPORT_SYMBOL(kmem_cache_shrink); |
3485 | 3486 | ||
3486 | #if defined(CONFIG_MEMORY_HOTPLUG) | ||
3487 | static int slab_mem_going_offline_callback(void *arg) | 3487 | static int slab_mem_going_offline_callback(void *arg) |
3488 | { | 3488 | { |
3489 | struct kmem_cache *s; | 3489 | struct kmem_cache *s; |
@@ -3598,7 +3598,10 @@ static int slab_memory_callback(struct notifier_block *self, | |||
3598 | return ret; | 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 | * Basic setup of slabs | 3607 | * Basic setup of slabs |
@@ -3651,7 +3654,7 @@ void __init kmem_cache_init(void) | |||
3651 | create_boot_cache(kmem_cache_node, "kmem_cache_node", | 3654 | create_boot_cache(kmem_cache_node, "kmem_cache_node", |
3652 | sizeof(struct kmem_cache_node), SLAB_HWCACHE_ALIGN); | 3655 | sizeof(struct kmem_cache_node), SLAB_HWCACHE_ALIGN); |
3653 | 3656 | ||
3654 | hotplug_memory_notifier(slab_memory_callback, SLAB_CALLBACK_PRI); | 3657 | register_hotmemory_notifier(&slab_memory_callback_nb); |
3655 | 3658 | ||
3656 | /* Able to allocate the per node structures */ | 3659 | /* Able to allocate the per node structures */ |
3657 | slab_state = PARTIAL; | 3660 | slab_state = PARTIAL; |