mm, thp: preventing hugepage creation for read-write file pages
authorSung-hun Kim <sfoon.kim@samsung.com>
Thu, 7 Oct 2021 07:57:39 +0000 (16:57 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Mon, 7 Feb 2022 08:01:41 +0000 (17:01 +0900)
commitaa6f643e3f57bd2bf4aba313b2108c10e45e1fa9
treebbe7d953afe23e65256ca37c6fd110e93017c94e
parent7149eed7f9377a7cd1ebc66da2c61885cee1e683
mm, thp: preventing hugepage creation for read-write file pages

Sometimes, an user process incurs writes on file pages
which has VM_DENYWRITE flag in its vma->vm_flags (of
course, the vma has VM_WRITE flags too). In this case,
the kernel creates a new page by a COW fault, but it is
an unexpected behaviour for 64KB file hugepages.

This patch disallows scanning of read-write file pages
to prevent unexpected buggy behaviours.

Change-Id: I28c1da7f7ad4be55be5607316b29a2978896fcb9
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
arch/arm64/mm/finegrained_thp.c
mm/khugepaged.c