Skip to content

Commit 4bfab20

Browse files
stevecapperlinaroRussell King
authored andcommitted
ARM: 7792/1: mm: Remove general hugetlb code from ARM
General forms of huge_pte_alloc, huge_pte_offset and follow_huge_pmd are now available in mm/hugetlb.c. This patch removes the ARM copies of these functions and activates the general ones by enabling: CONFIG_ARCH_WANT_GENERAL_HUGETLB Signed-off-by: Steve Capper <[email protected]> Acked-by: Catalin Marinas <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent c9218b1 commit 4bfab20

File tree

2 files changed

+3
-43
lines changed

2 files changed

+3
-43
lines changed

arch/arm/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,9 @@ config HAVE_ARCH_TRANSPARENT_HUGEPAGE
17931793
def_bool y
17941794
depends on ARM_LPAE
17951795

1796+
config ARCH_WANT_GENERAL_HUGETLB
1797+
def_bool y
1798+
17961799
source "mm/Kconfig"
17971800

17981801
config FORCE_MAX_ZONEORDER

arch/arm/mm/hugetlbpage.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,6 @@
3636
* of type casting from pmd_t * to pte_t *.
3737
*/
3838

39-
pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
40-
{
41-
pgd_t *pgd;
42-
pud_t *pud;
43-
pmd_t *pmd = NULL;
44-
45-
pgd = pgd_offset(mm, addr);
46-
if (pgd_present(*pgd)) {
47-
pud = pud_offset(pgd, addr);
48-
if (pud_present(*pud))
49-
pmd = pmd_offset(pud, addr);
50-
}
51-
52-
return (pte_t *)pmd;
53-
}
54-
5539
struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address,
5640
int write)
5741
{
@@ -68,33 +52,6 @@ int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep)
6852
return 0;
6953
}
7054

71-
pte_t *huge_pte_alloc(struct mm_struct *mm,
72-
unsigned long addr, unsigned long sz)
73-
{
74-
pgd_t *pgd;
75-
pud_t *pud;
76-
pte_t *pte = NULL;
77-
78-
pgd = pgd_offset(mm, addr);
79-
pud = pud_alloc(mm, pgd, addr);
80-
if (pud)
81-
pte = (pte_t *)pmd_alloc(mm, pud, addr);
82-
83-
return pte;
84-
}
85-
86-
struct page *
87-
follow_huge_pmd(struct mm_struct *mm, unsigned long address,
88-
pmd_t *pmd, int write)
89-
{
90-
struct page *page;
91-
92-
page = pte_page(*(pte_t *)pmd);
93-
if (page)
94-
page += ((address & ~PMD_MASK) >> PAGE_SHIFT);
95-
return page;
96-
}
97-
9855
int pmd_huge(pmd_t pmd)
9956
{
10057
return pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT);

0 commit comments

Comments
 (0)