Thread (17 messages) 17 messages, 3 authors, 2021-02-24
STALE1943d

[RFC PATCH 3/5] mm proc/task_mmu.c: add soft dirty pte checks for hugetlb

From: Mike Kravetz <hidden>
Date: 2021-02-11 00:05:55
Also in: linux-s390, lkml
Subsystem: filesystems (vfs and infrastructure), memory mapping, proc filesystem, the rest · Maintainers: Alexander Viro, Christian Brauner, Andrew Morton, Liam R. Howlett, Lorenzo Stoakes, Linus Torvalds

Pagemap was only using the vma flag PM_SOFT_DIRTY for hugetlb vmas.
This is insufficient.  Check the individual pte entries.

Signed-off-by: Mike Kravetz <redacted>
---
 fs/proc/task_mmu.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 602e3a52884d..829b35016aaa 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -1507,6 +1507,10 @@ static int pagemap_hugetlb_range(pte_t *ptep, unsigned long hmask,
 		flags |= PM_SOFT_DIRTY;
 
 	pte = huge_ptep_get(ptep);
+
+	if (huge_pte_soft_dirty(pte))
+		flags |= PM_SOFT_DIRTY;
+
 	if (pte_present(pte)) {
 		struct page *page = pte_page(pte);
 
-- 
2.29.2

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help