Unverified Commit 77b1032f authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8029 mm: introduce vm_swap_extension sysctl

Merge Pull Request from: @ci-robot 
 
PR sync from: Liu Shixin <liushixin2@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/3XTBWE45QW2ZV3SA4J4VPYCQ6Y5KKBC2/ 
Backport two patches which introduce vm_swap_extension sysctl.

Liu Shixin (2):
  mm/vmscan: introduce vm_swap_extension sysctl
  openeuler_defconfig: enable swap_extension for x86 and arm64


-- 
2.25.1
 
https://gitee.com/openeuler/kernel/issues/I9K8D1 
 
Link:https://gitee.com/openeuler/kernel/pulls/8029

 

Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 6f605852 0e155817
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ Currently, these files are in /proc/sys/vm:
- stat_refresh
- numa_stat
- swappiness
- swap_extension
- unprivileged_userfaultfd
- user_reserve_kbytes
- vfs_cache_pressure
@@ -928,6 +929,16 @@ At 0, the kernel will not initiate swap until the amount of free and
file-backed pages is less than the high watermark in a zone.


swap_extension
==============

This control is used for some swap extension feature. The default value is
0. Now support one extension which is to disable global swap which can't
acquired by swappiness.

To disable global swap:
	echo 1 > /proc/sys/vm/swap_extension

unprivileged_userfaultfd
========================

+1 −0
Original line number Diff line number Diff line
@@ -1127,6 +1127,7 @@ CONFIG_ETMEM_SWAP=m
CONFIG_ETMEM=y
CONFIG_USERSWAP=y
# CONFIG_PAGE_CACHE_LIMIT is not set
CONFIG_SWAP_EXTENSION=y
CONFIG_CMA=y
# CONFIG_CMA_DEBUG is not set
# CONFIG_CMA_DEBUGFS is not set
+1 −0
Original line number Diff line number Diff line
@@ -1060,6 +1060,7 @@ CONFIG_ETMEM_SWAP=m
CONFIG_ETMEM=y
CONFIG_USERSWAP=y
# CONFIG_PAGE_CACHE_LIMIT is not set
CONFIG_SWAP_EXTENSION=y
# CONFIG_CMA is not set
CONFIG_MEM_SOFT_DIRTY=y
CONFIG_ZSWAP=y
+3 −0
Original line number Diff line number Diff line
@@ -390,6 +390,9 @@ extern unsigned long mem_cgroup_shrink_node(struct mem_cgroup *mem,
						unsigned long *nr_scanned);
extern unsigned long shrink_all_memory(unsigned long nr_pages);
extern int vm_swappiness;
#ifdef CONFIG_SWAP_EXTENSION
extern int vm_swap_extension;
#endif
extern int remove_mapping(struct address_space *mapping, struct page *page);

extern unsigned long reclaim_pages(struct list_head *page_list);
+11 −0
Original line number Diff line number Diff line
@@ -2958,6 +2958,17 @@ static struct ctl_table vm_table[] = {
		.extra1		= SYSCTL_ZERO,
		.extra2		= &two_hundred,
	},
#ifdef CONFIG_SWAP_EXTENSION
	{
		.procname	= "swap_extension",
		.data		= &vm_swap_extension,
		.maxlen		= sizeof(vm_swap_extension),
		.mode		= 0644,
		.proc_handler	= proc_dointvec_minmax,
		.extra1		= SYSCTL_ZERO,
		.extra2		= SYSCTL_ONE,
	},
#endif
#ifdef CONFIG_NUMA
	{
		.procname	= "numa_stat",
Loading