Commit 97f5420e authored by Kaixiong Yu's avatar Kaixiong Yu Committed by Joel Granados
Browse files

mm: nommu: move sysctl to mm/nommu.c



The sysctl_nr_trim_pages belongs to nommu.c, move it to mm/nommu.c
from /kernel/sysctl.c. And remove the useless extern variable declaration
from include/linux/mm.h

Signed-off-by: default avatarKaixiong Yu <yukaixiong@huawei.com>
Reviewed-by: default avatarLorenzo Stoakes <lorenzo.stoakes@oracle.com>
Signed-off-by: default avatarJoel Granados <joel.granados@kernel.org>
parent b121dd4d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -4066,8 +4066,6 @@ unsigned long wp_shared_mapping_range(struct address_space *mapping,
				      pgoff_t first_index, pgoff_t nr);
#endif

extern int sysctl_nr_trim_pages;

#ifdef CONFIG_ANON_VMA_NAME
int madvise_set_anon_name(struct mm_struct *mm, unsigned long start,
			  unsigned long len_in,
+0 −10
Original line number Diff line number Diff line
@@ -2031,16 +2031,6 @@ static const struct ctl_table vm_table[] = {
		.extra1		= SYSCTL_ONE,
		.extra2		= SYSCTL_FOUR,
	},
#ifndef CONFIG_MMU
	{
		.procname	= "nr_trim_pages",
		.data		= &sysctl_nr_trim_pages,
		.maxlen		= sizeof(sysctl_nr_trim_pages),
		.mode		= 0644,
		.proc_handler	= proc_dointvec_minmax,
		.extra1		= SYSCTL_ZERO,
	},
#endif
	{
		.procname	= "vfs_cache_pressure",
		.data		= &sysctl_vfs_cache_pressure,
+14 −1
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ struct page *mem_map;
unsigned long max_mapnr;
EXPORT_SYMBOL(max_mapnr);
unsigned long highest_memmap_pfn;
int sysctl_nr_trim_pages = CONFIG_NOMMU_INITIAL_TRIM_EXCESS;
int heap_stack_gap = 0;

atomic_long_t mmap_pages_allocated;
@@ -392,6 +391,19 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
	return mm->brk = brk;
}

static int sysctl_nr_trim_pages = CONFIG_NOMMU_INITIAL_TRIM_EXCESS;

static const struct ctl_table nommu_table[] = {
	{
		.procname	= "nr_trim_pages",
		.data		= &sysctl_nr_trim_pages,
		.maxlen		= sizeof(sysctl_nr_trim_pages),
		.mode		= 0644,
		.proc_handler	= proc_dointvec_minmax,
		.extra1		= SYSCTL_ZERO,
	},
};

/*
 * initialise the percpu counter for VM and region record slabs
 */
@@ -402,6 +414,7 @@ void __init mmap_init(void)
	ret = percpu_counter_init(&vm_committed_as, 0, GFP_KERNEL);
	VM_BUG_ON(ret);
	vm_region_jar = KMEM_CACHE(vm_region, SLAB_PANIC|SLAB_ACCOUNT);
	register_sysctl_init("vm", nommu_table);
}

/*