Skip to content

Commit

Permalink
s390/hugetlb: switch to generic version of follow_huge_pud()
Browse files Browse the repository at this point in the history
When pud-sized hugepages were introduced for s390, the generic version of
follow_huge_pud() was using pte_page() instead of pud_page().  This would
be wrong for s390, see also commit 9753412 ("mm/hugetlb: use
pmd_page() in follow_huge_pmd()").  Therefore, and probably because not
all archs were supporting pud_page() at that time, a private version of
follow_huge_pud() was added for s390, correctly using pud_page().

Since commit 3a194f3 ("mm/hugetlb: make pud_huge() and
follow_huge_pud() aware of non-present pud entry"), the generic version of
follow_huge_pud() is now also using pud_page(), and in general behaves
similar to follow_huge_pmd().

Therefore we can now switch to the generic version and get rid of the
s390-specific follow_huge_pud().

Link: https://lkml.kernel.org/r/20220818135717.609eef8a@thinkpad
Signed-off-by: Gerald Schaefer <[email protected]>
Cc: Haiyue Wang <[email protected]>
Cc: Miaohe Lin <[email protected]>
Cc: "Huang, Ying" <[email protected]>
Cc: Baolin Wang <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Muchun Song <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
gerald-schaefer authored and akpm00 committed Sep 12, 2022
1 parent 1813e51 commit 1a6baaa
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions arch/s390/mm/hugetlbpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,16 +237,6 @@ int pud_huge(pud_t pud)
return pud_large(pud);
}

struct page *
follow_huge_pud(struct mm_struct *mm, unsigned long address,
pud_t *pud, int flags)
{
if (flags & FOLL_GET)
return NULL;

return pud_page(*pud) + ((address & ~PUD_MASK) >> PAGE_SHIFT);
}

bool __init arch_hugetlb_valid_size(unsigned long size)
{
if (MACHINE_HAS_EDAT1 && size == PMD_SIZE)
Expand Down

0 comments on commit 1a6baaa

Please sign in to comment.