Thread (59 messages) 59 messages, 8 authors, 2025-06-12

Re: [PATCH 07/12] mm: Remove redundant pXd_devmap calls

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Date: 2025-05-29 11:54:40
Also in: dri-devel, linux-arm-kernel, linux-cxl, linux-ext4, linux-fsdevel, linux-mm, linux-riscv, linux-xfs, lkml, loongarch, nvdimm

On Thu, 29 May 2025 16:32:08 +1000
Alistair Popple [off-list ref] wrote:
DAX was the only thing that created pmd_devmap and pud_devmap entries
however it no longer does as DAX pages are now refcounted normally and
pXd_trans_huge() returns true for those. Therefore checking both pXd_devmap
and pXd_trans_huge() is redundant and the former can be removed without
changing behaviour as it will always be false.

Signed-off-by: Alistair Popple <apopple@nvidia.com>
quoted hunk ↗ jump to hunk
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 8d9d706..31b4110 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1398,10 +1398,7 @@ static int insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr,
 	}
 
 	entry = pmd_mkhuge(pfn_t_pmd(pfn, prot));
-	if (pfn_t_devmap(pfn))
Didn't this go away in patch 5?  I didn't check but this looks like a bisectability issue.
-		entry = pmd_mkdevmap(entry);
-	else
-		entry = pmd_mkspecial(entry);
+	entry = pmd_mkspecial(entry);
 	if (write) {
 		entry = pmd_mkyoung(pmd_mkdirty(entry));
 		entry = maybe_pmd_mkwrite(entry, vma);
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help