linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ke Sun <sunke@kylinos.cn>
To: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Ke Sun <sunke@kylinos.cn>
Subject: [RESEND PATCH RFC] mm: pagemap: add vma(VM_PFNMAP) support in pagemap_pte_hole()
Date: Thu, 23 Feb 2023 10:43:32 +0800	[thread overview]
Message-ID: <20230223024332.1337578-1-sunke@kylinos.cn> (raw)

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



                 reply	other threads:[~2023-02-23  2:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230223024332.1337578-1-sunke@kylinos.cn \
    --to=sunke@kylinos.cn \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox