Skip to content

Commit ef713ec

Browse files
xzpeterakpm00
authored andcommitted
mm: drop is_huge_zero_pud()
It constantly returns false since 2017. One assertion is added in 2019 but it should never have triggered, IOW it means what is checked should be asserted instead. If it didn't exist for 7 years maybe it's good idea to remove it and only add it when it comes. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Peter Xu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Acked-by: David Hildenbrand <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Alex Williamson <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Gavin Shan <[email protected]> Cc: Gerald Schaefer <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Niklas Schnelle <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Ryan Roberts <[email protected]> Cc: Sean Christopherson <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Will Deacon <[email protected]> Cc: Zi Yan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 6857be5 commit ef713ec

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

include/linux/huge_mm.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,6 @@ static inline bool is_huge_zero_pmd(pmd_t pmd)
433433
return pmd_present(pmd) && READ_ONCE(huge_zero_pfn) == pmd_pfn(pmd);
434434
}
435435

436-
static inline bool is_huge_zero_pud(pud_t pud)
437-
{
438-
return false;
439-
}
440-
441436
struct folio *mm_get_huge_zero_folio(struct mm_struct *mm);
442437
void mm_put_huge_zero_folio(struct mm_struct *mm);
443438

@@ -578,11 +573,6 @@ static inline bool is_huge_zero_pmd(pmd_t pmd)
578573
return false;
579574
}
580575

581-
static inline bool is_huge_zero_pud(pud_t pud)
582-
{
583-
return false;
584-
}
585-
586576
static inline void mm_put_huge_zero_folio(struct mm_struct *mm)
587577
{
588578
return;

mm/huge_memory.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,10 +1453,8 @@ static void insert_pfn_pud(struct vm_area_struct *vma, unsigned long addr,
14531453
ptl = pud_lock(mm, pud);
14541454
if (!pud_none(*pud)) {
14551455
if (write) {
1456-
if (pud_pfn(*pud) != pfn_t_to_pfn(pfn)) {
1457-
WARN_ON_ONCE(!is_huge_zero_pud(*pud));
1456+
if (WARN_ON_ONCE(pud_pfn(*pud) != pfn_t_to_pfn(pfn)))
14581457
goto out_unlock;
1459-
}
14601458
entry = pud_mkyoung(*pud);
14611459
entry = maybe_pud_mkwrite(pud_mkdirty(entry), vma);
14621460
if (pudp_set_access_flags(vma, addr, pud, entry, 1))
@@ -1704,15 +1702,6 @@ int copy_huge_pud(struct mm_struct *dst_mm, struct mm_struct *src_mm,
17041702
if (unlikely(!pud_trans_huge(pud) && !pud_devmap(pud)))
17051703
goto out_unlock;
17061704

1707-
/*
1708-
* When page table lock is held, the huge zero pud should not be
1709-
* under splitting since we don't split the page itself, only pud to
1710-
* a page table.
1711-
*/
1712-
if (is_huge_zero_pud(pud)) {
1713-
/* No huge zero pud yet */
1714-
}
1715-
17161705
/*
17171706
* TODO: once we support anonymous pages, use
17181707
* folio_try_dup_anon_rmap_*() and split if duplicating fails.

0 commit comments

Comments
 (0)