lkml.org 
[lkml]   [2023]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 3/4] smaps: use vm_normal_page_pmd() instead of follow_trans_huge_pmd()
Date
We really shouldn't be using a GUP-internal helper if it can be avoided,
and avoiding the FOLL_FORCE here is certainly desirable.

Similar to smaps_pte_entry() that uses vm_normal_page(), let's use
vm_normal_page_pmd() -- that didn't exist back when we introduced that
code -- that similarly refuses to return the huge zeropage.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
fs/proc/task_mmu.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 7075ce11dc7d..b8ea270bf68b 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -571,12 +571,7 @@ static void smaps_pmd_entry(pmd_t *pmd, unsigned long addr,
bool migration = false;

if (pmd_present(*pmd)) {
- /*
- * FOLL_DUMP will return -EFAULT on huge zero page
- * FOLL_FORCE follow a PROT_NONE mapped page
- */
- page = follow_trans_huge_pmd(vma, addr, pmd,
- FOLL_DUMP | FOLL_FORCE);
+ page = vm_normal_page_pmd(vma, addr, *pmd);
} else if (unlikely(thp_migration_supported() && is_swap_pmd(*pmd))) {
swp_entry_t entry = pmd_to_swp_entry(*pmd);

--
2.41.0
\
 
 \ /
  Last update: 2023-07-27 23:31    [W:0.169 / U:1.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site