提交 5b365771 编写于 作者: Y Yang Shi 提交者: Linus Torvalds

mm: slabinfo: remove CONFIG_SLABINFO

According to discussion with Christoph
(https://marc.info/?l=linux-kernel&m=150695909709711&w=2), it sounds like
it is pointless to keep CONFIG_SLABINFO around.

This patch removes the CONFIG_SLABINFO config option, but /proc/slabinfo
is still available.

[yang.s@alibaba-inc.com: v11]
  Link: http://lkml.kernel.org/r/1507656303-103845-3-git-send-email-yang.s@alibaba-inc.com
Link: http://lkml.kernel.org/r/1507152550-46205-3-git-send-email-yang.s@alibaba-inc.comSigned-off-by: NYang Shi <yang.s@alibaba-inc.com>
Acked-by: NDavid Rientjes <rientjes@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 7ad3f188
...@@ -1664,12 +1664,6 @@ config HAVE_GENERIC_DMA_COHERENT ...@@ -1664,12 +1664,6 @@ config HAVE_GENERIC_DMA_COHERENT
bool bool
default n default n
config SLABINFO
bool
depends on PROC_FS
depends on SLAB || SLUB_DEBUG
default y
config RT_MUTEXES config RT_MUTEXES
bool bool
......
...@@ -4049,7 +4049,7 @@ static struct cftype mem_cgroup_legacy_files[] = { ...@@ -4049,7 +4049,7 @@ static struct cftype mem_cgroup_legacy_files[] = {
.write = mem_cgroup_reset, .write = mem_cgroup_reset,
.read_u64 = mem_cgroup_read_u64, .read_u64 = mem_cgroup_read_u64,
}, },
#ifdef CONFIG_SLABINFO #if defined(CONFIG_SLAB) || defined(CONFIG_SLUB_DEBUG)
{ {
.name = "kmem.slabinfo", .name = "kmem.slabinfo",
.seq_start = memcg_slab_start, .seq_start = memcg_slab_start,
......
...@@ -4097,7 +4097,6 @@ static void cache_reap(struct work_struct *w) ...@@ -4097,7 +4097,6 @@ static void cache_reap(struct work_struct *w)
schedule_delayed_work(work, round_jiffies_relative(REAPTIMEOUT_AC)); schedule_delayed_work(work, round_jiffies_relative(REAPTIMEOUT_AC));
} }
#ifdef CONFIG_SLABINFO
void get_slabinfo(struct kmem_cache *cachep, struct slabinfo *sinfo) void get_slabinfo(struct kmem_cache *cachep, struct slabinfo *sinfo)
{ {
unsigned long active_objs, num_objs, active_slabs; unsigned long active_objs, num_objs, active_slabs;
...@@ -4405,7 +4404,6 @@ static int __init slab_proc_init(void) ...@@ -4405,7 +4404,6 @@ static int __init slab_proc_init(void)
return 0; return 0;
} }
module_init(slab_proc_init); module_init(slab_proc_init);
#endif
#ifdef CONFIG_HARDENED_USERCOPY #ifdef CONFIG_HARDENED_USERCOPY
/* /*
......
...@@ -1184,8 +1184,7 @@ void cache_random_seq_destroy(struct kmem_cache *cachep) ...@@ -1184,8 +1184,7 @@ void cache_random_seq_destroy(struct kmem_cache *cachep)
} }
#endif /* CONFIG_SLAB_FREELIST_RANDOM */ #endif /* CONFIG_SLAB_FREELIST_RANDOM */
#ifdef CONFIG_SLABINFO #if defined(CONFIG_SLAB) || defined(CONFIG_SLUB_DEBUG)
#ifdef CONFIG_SLAB #ifdef CONFIG_SLAB
#define SLABINFO_RIGHTS (S_IWUSR | S_IRUSR) #define SLABINFO_RIGHTS (S_IWUSR | S_IRUSR)
#else #else
...@@ -1281,7 +1280,7 @@ static int slab_show(struct seq_file *m, void *p) ...@@ -1281,7 +1280,7 @@ static int slab_show(struct seq_file *m, void *p)
return 0; return 0;
} }
#if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) #if defined(CONFIG_MEMCG)
void *memcg_slab_start(struct seq_file *m, loff_t *pos) void *memcg_slab_start(struct seq_file *m, loff_t *pos)
{ {
struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m));
...@@ -1355,7 +1354,7 @@ static int __init slab_proc_init(void) ...@@ -1355,7 +1354,7 @@ static int __init slab_proc_init(void)
return 0; return 0;
} }
module_init(slab_proc_init); module_init(slab_proc_init);
#endif /* CONFIG_SLABINFO */ #endif /* CONFIG_SLAB || CONFIG_SLUB_DEBUG */
static __always_inline void *__do_krealloc(const void *p, size_t new_size, static __always_inline void *__do_krealloc(const void *p, size_t new_size,
gfp_t flags) gfp_t flags)
......
...@@ -5852,7 +5852,7 @@ __initcall(slab_sysfs_init); ...@@ -5852,7 +5852,7 @@ __initcall(slab_sysfs_init);
/* /*
* The /proc/slabinfo ABI * The /proc/slabinfo ABI
*/ */
#ifdef CONFIG_SLABINFO #ifdef CONFIG_SLUB_DEBUG
void get_slabinfo(struct kmem_cache *s, struct slabinfo *sinfo) void get_slabinfo(struct kmem_cache *s, struct slabinfo *sinfo)
{ {
unsigned long nr_slabs = 0; unsigned long nr_slabs = 0;
...@@ -5884,4 +5884,4 @@ ssize_t slabinfo_write(struct file *file, const char __user *buffer, ...@@ -5884,4 +5884,4 @@ ssize_t slabinfo_write(struct file *file, const char __user *buffer,
{ {
return -EIO; return -EIO;
} }
#endif /* CONFIG_SLABINFO */ #endif /* CONFIG_SLUB_DEBUG */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册