[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <68427031c58645ba4b751022bf032ffd6b247427.1712796818.git-series.apopple@nvidia.com>
Date: Thu, 11 Apr 2024 10:57:30 +1000
From: Alistair Popple <apopple@...dia.com>
To: linux-mm@...ck.org
Cc: david@...morbit.com,
dan.j.williams@...el.com,
jhubbard@...dia.com,
rcampbell@...dia.com,
willy@...radead.org,
jgg@...dia.com,
linux-fsdevel@...r.kernel.org,
jack@...e.cz,
djwong@...nel.org,
hch@....de,
david@...hat.com,
ruansy.fnst@...itsu.com,
nvdimm@...ts.linux.dev,
linux-xfs@...r.kernel.org,
linux-ext4@...r.kernel.org,
jglisse@...hat.com,
Alistair Popple <apopple@...dia.com>
Subject: [RFC 09/10] mm/khugepage.c: Warn if trying to scan devmap pmd
The only user of devmap PTEs is FS DAX, and khugepaged should not be
scanning these VMAs. This is checked by calling
hugepage_vma_check. Therefore khugepaged should never encounter a
devmap PTE. Warn if this occurs.
Signed-off-by: Alistair Popple <apopple@...dia.com>
---
Note this is a transitory patch to test the above assumption both at
runtime and during review. I will likely remove it as the whole thing
gets deleted when pXX_devmap is removed.
---
mm/khugepaged.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 88433cc..b10db15 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -955,7 +955,7 @@ static int find_pmd_or_thp_or_none(struct mm_struct *mm,
return SCAN_PMD_NULL;
if (pmd_trans_huge(pmde))
return SCAN_PMD_MAPPED;
- if (pmd_devmap(pmde))
+ if (WARN_ON_ONCE(pmd_devmap(pmde)))
return SCAN_PMD_NULL;
if (pmd_bad(pmde))
return SCAN_PMD_NULL;
--
git-series 0.9.1
Powered by blists - more mailing lists