* [RESEND PATCH RFC] mm: pagemap: add vma(VM_PFNMAP) support in pagemap_pte_hole()
@ 2023-02-23 2:43 Ke Sun
0 siblings, 0 replies; only message in thread
From: Ke Sun @ 2023-02-23 2:43 UTC (permalink / raw)
To: Andrew Morton, Matthew Wilcox; +Cc: linux-kernel, linux-mm, Ke Sun
pagemap currently does not support vma(FIXMAP), add support
in pagemap_pte_hole().
Signed-off-by: Ke Sun <sunke@kylinos.cn>
---
fs/proc/task_mmu.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index af1c49ae11b1..297c7b9dc630 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -1400,6 +1400,11 @@ static int pagemap_pte_hole(unsigned long start, unsigned long end,
if (vma->vm_flags & VM_SOFTDIRTY)
pme = make_pme(0, PM_SOFT_DIRTY);
for (; addr < min(end, vma->vm_end); addr += PAGE_SIZE) {
+ if ((vma->vm_flags & VM_PFNMAP) && vma->vm_pgoff) {
+ unsigned long pgoff = (addr - vma->vm_start) >> PAGE_SHIFT;
+
+ pme = make_pme(vma->vm_pgoff + pgoff, PM_PRESENT);
+ }
err = add_to_pagemap(addr, &pme, pm);
if (err)
goto out;
--
2.25.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-02-23 2:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23 2:43 [RESEND PATCH RFC] mm: pagemap: add vma(VM_PFNMAP) support in pagemap_pte_hole() Ke Sun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox