From: Wang Wensheng <wangwensheng4@huawei.com> Offering: HULK hulk inclusion category: feature bugzilla: NA ---------------------------------------- The address range of sharepool could affect TSAN in mdc scene, so we cannot change it. Introduce a new config to isolate the features that modify the address range of sharepool. Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com> --- include/linux/share_pool.h | 47 ++++++++++++++++++++++++++++++++++++-- mm/Kconfig | 9 ++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/include/linux/share_pool.h b/include/linux/share_pool.h index 147e99620b9d..ea581516838c 100644 --- a/include/linux/share_pool.h +++ b/include/linux/share_pool.h @@ -72,12 +72,23 @@ struct sp_walk_data { #define MMAP_SHARE_POOL_DVPP_SIZE 0x80000000000UL /* 16G size */ #define MMAP_SHARE_POOL_16G_SIZE 0x400000000UL + +#ifdef CONFIG_SHARE_POOL_ADDRESS_SPACE_MDC_SCENE + +/* skip 8T for stack */ +#define MMAP_SHARE_POOL_SKIP 0x80000000000UL + +#else + /* skip 16T for stack */ #define MMAP_SHARE_POOL_SKIP 0x100000000000UL + +#endif + #define MMAP_SHARE_POOL_END (TASK_SIZE - MMAP_SHARE_POOL_SKIP) -#define MMAP_SHARE_POLL_DVPP_END (MMAP_SHARE_POOL_END) +#define MMAP_SHARE_POOL_DVPP_END (MMAP_SHARE_POOL_END) /* MMAP_SHARE_POOL_DVPP_START should be align to 16G */ -#define MMAP_SHARE_POOL_DVPP_START (MMAP_SHARE_POLL_DVPP_END - MMAP_SHARE_POOL_DVPP_SIZE) +#define MMAP_SHARE_POOL_DVPP_START (MMAP_SHARE_POOL_DVPP_END - MMAP_SHARE_POOL_DVPP_SIZE) #define MMAP_SHARE_POOL_RO_END (MMAP_SHARE_POOL_DVPP_START) #define MMAP_SHARE_POOL_RO_START (MMAP_SHARE_POOL_RO_END - MMAP_SHARE_POOL_RO_SIZE) #define MMAP_SHARE_POOL_NORMAL_END (MMAP_SHARE_POOL_RO_START) @@ -88,6 +99,38 @@ struct sp_walk_data { #define MMAP_SHARE_POOL_DYNAMIC_DVPP_END (MMAP_SHARE_POOL_DYNAMIC_DVPP_BASE + \ MMAP_SHARE_POOL_16G_SIZE * 64) +/* + * Address space for mdc scene + * |-------------------------------| <------- 0x1000000000000 + * | Stack | 8T + * |-------------------------------| <------- 0xf80000000000 + * | DVPP normal area | 8T + * |-------------------------------| <------- 0xf00000000000 + * | force readonly area | 64G + * |-------------------------------| <------- + * | Normal sharepool area | 8T - 64G + * |-------------------------------| <------- 0xe80000000000 + * | mmap area | + * |-------------------------------| + * + * Address space for dc scene + * |-------------------------------| <------- 0x1000000000000 + * | Stack | 8T + * |-------------------------------| <------- 0xf80000000000 + * | non-cache area | 8T + * |-------------------------------| <------- 0xf00000000000 + * | DVPP normal area | 8T + * |-------------------------------| <------- 0xe80000000000 + * | force readonly area | 64G + * |-------------------------------| <------- + * | Normal sharepool area | 8T - 64G + * |-------------------------------| <------- 0xe00000000000 + * | mmap area | + * |-------------------------------| + * | dynamic dvpp area | + * |-------------------------------| + */ + typedef unsigned long (*sp_alloc_hugepage_fn)(unsigned long size, int nid, nodemask_t *nodemask); #ifdef CONFIG_SHARE_POOL diff --git a/mm/Kconfig b/mm/Kconfig index 342710408a2b..2d4a83f4b5ad 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -1446,6 +1446,15 @@ config GUP_LONGTERM_ALLOW_MOVEABLE_MEMORY memory will not be offlined in the ascend scenario, we allow to alloc moveable mmeory when FOLL_LONGTERM is set. +config SHARE_POOL_ADDRESS_SPACE_MDC_SCENE + bool "Apply the address space of sharepool to MDC scene" + default n + depends on SHARE_POOL + help + Because the address space for sharepool could affect TSAN in mdc scene, + we cannot change it. Use this config to isolate some features that + change the sharepool address range and are not used in mdc scene. + config ASCEND_OOM bool "Enable support for disable oom killer" depends on ASCEND_FEATURES -- 2.43.0