mm: thp: Revert "mm, thp: preventing hugepage creation for read-write file pages" 73/270673/3 submit/tizen/20220208.074352
authorMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 8 Feb 2022 07:16:00 +0000 (08:16 +0100)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 8 Feb 2022 07:28:32 +0000 (07:28 +0000)
Once the issue with modified read-only files has been fixed by the commit
"mm: thp: avoid mapping a 64kB THP when anonymous COW-ed pages exist",
this workaround is no longer needed.

This reverts commit bca41ebfc598858807071491cdb85f61773d8a77.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I3df73b53fffe6dc49bbc844852aff68e4157582b

arch/arm64/mm/finegrained_thp.c
mm/khugepaged.c

index 570747c..5ebb4ac 100644 (file)
@@ -17,7 +17,7 @@ bool arm64_hugepage_vma_file_check(struct vm_area_struct *vma,
 {
        /* Read-only file mappings need to be aligned for THP to work. */
        if (IS_ENABLED(CONFIG_READ_ONLY_THP_FOR_FS) && vma->vm_file &&
-           (vm_flags & VM_DENYWRITE) && !(vm_flags & VM_WRITE)) {
+           (vm_flags & VM_DENYWRITE)) {
                return IS_ALIGNED((vma->vm_start >> PAGE_SHIFT) - vma->vm_pgoff,
                                nr_pages);
        }
index e76b568..f88ad1b 100644 (file)
@@ -513,7 +513,7 @@ static bool hugepage_vma_check(struct vm_area_struct *vma,
                return true;
        /* Only regular file is valid */
        else if (IS_ENABLED(CONFIG_READ_ONLY_THP_FOR_FS) && vma->vm_file &&
-           (vm_flags & VM_DENYWRITE) && !(vm_flags & VM_WRITE)) {
+           (vm_flags & VM_DENYWRITE)) {
                struct inode *inode = vma->vm_file->f_inode;
 
                return S_ISREG(inode->i_mode);