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

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 <steve.capper@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Steven Capper and committed by
Russell King
4bfab203 c9218b16

+3 -43
+3
arch/arm/Kconfig
··· 1793 1793 def_bool y 1794 1794 depends on ARM_LPAE 1795 1795 1796 + config ARCH_WANT_GENERAL_HUGETLB 1797 + def_bool y 1798 + 1796 1799 source "mm/Kconfig" 1797 1800 1798 1801 config FORCE_MAX_ZONEORDER
-43
arch/arm/mm/hugetlbpage.c
··· 36 36 * of type casting from pmd_t * to pte_t *. 37 37 */ 38 38 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 - 55 39 struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, 56 40 int write) 57 41 { ··· 50 66 int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep) 51 67 { 52 68 return 0; 53 - } 54 - 55 - pte_t *huge_pte_alloc(struct mm_struct *mm, 56 - unsigned long addr, unsigned long sz) 57 - { 58 - pgd_t *pgd; 59 - pud_t *pud; 60 - pte_t *pte = NULL; 61 - 62 - pgd = pgd_offset(mm, addr); 63 - pud = pud_alloc(mm, pgd, addr); 64 - if (pud) 65 - pte = (pte_t *)pmd_alloc(mm, pud, addr); 66 - 67 - return pte; 68 - } 69 - 70 - struct page * 71 - follow_huge_pmd(struct mm_struct *mm, unsigned long address, 72 - pmd_t *pmd, int write) 73 - { 74 - struct page *page; 75 - 76 - page = pte_page(*(pte_t *)pmd); 77 - if (page) 78 - page += ((address & ~PMD_MASK) >> PAGE_SHIFT); 79 - return page; 80 69 } 81 70 82 71 int pmd_huge(pmd_t pmd)