Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/huge_memory: remove pXd_devmap usage from insert_pXd_pfn()

Nothing uses PFN_DEV anymore so no need to create devmap pXd's when
mapping a PFN. Instead special mappings will be created which ensures
vm_normal_page_pXd() will not return pages which don't have an associated
page. This could change behaviour slightly on architectures where
pXd_devmap() does not imply pXd_special() as the normal page checks would
have fallen through to checking VM_PFNMAP/MIXEDMAP instead, which in
theory at least could have returned a page.

However vm_normal_page_pXd() should never have been returning pages for
pXd_devmap() entries anyway, so anything relying on that would have been a
bug.

Link: https://lkml.kernel.org/r/cd8658f9ff10afcfffd8b145a39d98bf1c595ffa.1750323463.git-series.apopple@nvidia.com
Signed-off-by: Alistair Popple <apopple@nvidia.com>
Cc: Balbir Singh <balbirs@nvidia.com>
Cc: Björn Töpel <bjorn@kernel.org>
Cc: Björn Töpel <bjorn@rivosinc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Chunyan Zhang <zhang.lyra@gmail.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Deepak Gupta <debug@rivosinc.com>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Inki Dae <m.szyprowski@samsung.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: John Groves <john@groves.net>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Alistair Popple and committed by
Andrew Morton
7b2ae3c4 fd2825b0

+2 -10
+2 -10
mm/huge_memory.c
··· 1415 1415 add_mm_counter(mm, mm_counter_file(fop.folio), HPAGE_PMD_NR); 1416 1416 } else { 1417 1417 entry = pmd_mkhuge(pfn_t_pmd(fop.pfn, prot)); 1418 - 1419 - if (pfn_t_devmap(fop.pfn)) 1420 - entry = pmd_mkdevmap(entry); 1421 - else 1422 - entry = pmd_mkspecial(entry); 1418 + entry = pmd_mkspecial(entry); 1423 1419 } 1424 1420 if (write) { 1425 1421 entry = pmd_mkyoung(pmd_mkdirty(entry)); ··· 1561 1565 add_mm_counter(mm, mm_counter_file(fop.folio), HPAGE_PUD_NR); 1562 1566 } else { 1563 1567 entry = pud_mkhuge(pfn_t_pud(fop.pfn, prot)); 1564 - 1565 - if (pfn_t_devmap(fop.pfn)) 1566 - entry = pud_mkdevmap(entry); 1567 - else 1568 - entry = pud_mkspecial(entry); 1568 + entry = pud_mkspecial(entry); 1569 1569 } 1570 1570 if (write) { 1571 1571 entry = pud_mkyoung(pud_mkdirty(entry));