aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--init/Kconfig2
-rw-r--r--mm/slub.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 3e7b257fc05..6a44defac3e 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -720,7 +720,7 @@ config VM_EVENT_COUNTERS
720config SLUB_DEBUG 720config SLUB_DEBUG
721 default y 721 default y
722 bool "Enable SLUB debugging support" if EMBEDDED 722 bool "Enable SLUB debugging support" if EMBEDDED
723 depends on SLUB 723 depends on SLUB && SYSFS
724 help 724 help
725 SLUB has extensive debug support features. Disabling these can 725 SLUB has extensive debug support features. Disabling these can
726 result in significant savings in code size. This also disables 726 result in significant savings in code size. This also disables
diff --git a/mm/slub.c b/mm/slub.c
index c9c12ac7961..d379b782fc8 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -217,7 +217,7 @@ struct track {
217 217
218enum track_item { TRACK_ALLOC, TRACK_FREE }; 218enum track_item { TRACK_ALLOC, TRACK_FREE };
219 219
220#if defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG) 220#ifdef CONFIG_SLUB_DEBUG
221static int sysfs_slab_add(struct kmem_cache *); 221static int sysfs_slab_add(struct kmem_cache *);
222static int sysfs_slab_alias(struct kmem_cache *, const char *); 222static int sysfs_slab_alias(struct kmem_cache *, const char *);
223static void sysfs_slab_remove(struct kmem_cache *); 223static void sysfs_slab_remove(struct kmem_cache *);
@@ -3247,7 +3247,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
3247 return slab_alloc(s, gfpflags, node, caller); 3247 return slab_alloc(s, gfpflags, node, caller);
3248} 3248}
3249 3249
3250#if (defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG)) || defined(CONFIG_SLABINFO) 3250#ifdef CONFIG_SLUB_DEBUG
3251static unsigned long count_partial(struct kmem_cache_node *n, 3251static unsigned long count_partial(struct kmem_cache_node *n,
3252 int (*get_count)(struct page *)) 3252 int (*get_count)(struct page *))
3253{ 3253{
@@ -3276,9 +3276,7 @@ static int count_free(struct page *page)
3276{ 3276{
3277 return page->objects - page->inuse; 3277 return page->objects - page->inuse;
3278} 3278}
3279#endif
3280 3279
3281#if defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG)
3282static int validate_slab(struct kmem_cache *s, struct page *page, 3280static int validate_slab(struct kmem_cache *s, struct page *page,
3283 unsigned long *map) 3281 unsigned long *map)
3284{ 3282{