anolis: mm: avoid pgtable_share enabled by default

ANBZ: #9321

Currently pgtable_share is enabled after system initialization, better to
disable it by default, and enable it when needed.

Signed-off-by: Kaihao Bai <carlo.bai@linux.alibaba.com>
Reviewed-by: Xu Yu <xuyu@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/3345
This commit is contained in:
Kaihao Bai 2024-06-13 11:27:37 +08:00
parent 9c618832da
commit 3fddefcb79
2 changed files with 2 additions and 2 deletions

View File

@ -48,7 +48,7 @@ static inline bool vma_is_pgtable_shadow(const struct vm_area_struct *vma)
vma->vm_mm == vma->pgtable_share_data->mm;
}
DECLARE_STATIC_KEY_TRUE(pgtable_share_enabled_key);
DECLARE_STATIC_KEY_FALSE(pgtable_share_enabled_key);
static inline bool pgtable_share_enable(void)
{
return static_branch_unlikely(&pgtable_share_enabled_key);

View File

@ -484,7 +484,7 @@ void pgtable_share_adjust_range(struct vm_area_struct *vma, unsigned long *start
*end = ALIGN(*end, PMD_SIZE);
}
DEFINE_STATIC_KEY_TRUE(pgtable_share_enabled_key);
DEFINE_STATIC_KEY_FALSE(pgtable_share_enabled_key);
static int __init setup_pgtable_share(char *s)
{
if (!strcmp(s, "1"))