]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
mm/hugetlb: Allow arch to override and call the weak function
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Fri, 15 Dec 2017 15:20:36 +0000 (10:20 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 14 Mar 2018 10:40:37 +0000 (11:40 +0100)
BugLink: http://bugs.launchpad.net/bugs/1706247
When running in guest mode ppc64 supports a different mechanism for hugetlb
allocation/reservation. The LPAR management application called HMC can
be used to reserve a set of hugepages and we pass the details of
reserved pages via device tree to the guest. (more details in
htab_dt_scan_hugepage_blocks()) . We do the memblock_reserve of the range
and later in the boot sequence, we add the reserved range to huge_boot_pages.

But to enable 16G hugetlb on baremetal config (when we are not running as guest)
we want to do memblock reservation during boot. Generic code already does this

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit e24a1307ba1f99fc62a0bd61d5e87fcfb6d5503d)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
include/linux/hugetlb.h
mm/hugetlb.c

index 0ed8e41aaf1173d3722a058f3be7c01828ca9284..8bbbd37ab10508571f634203469680090dd435b8 100644 (file)
@@ -358,6 +358,7 @@ int huge_add_to_page_cache(struct page *page, struct address_space *mapping,
                        pgoff_t idx);
 
 /* arch callback */
+int __init __alloc_bootmem_huge_page(struct hstate *h);
 int __init alloc_bootmem_huge_page(struct hstate *h);
 
 void __init hugetlb_bad_size(void);
index 011725849f52916bdf8840065fac874cc21c9aec..a2d2d81a1d61484df1b45d559729f1a3c36e1268 100644 (file)
@@ -2083,7 +2083,9 @@ struct page *alloc_huge_page_noerr(struct vm_area_struct *vma,
        return page;
 }
 
-int __weak alloc_bootmem_huge_page(struct hstate *h)
+int alloc_bootmem_huge_page(struct hstate *h)
+       __attribute__ ((weak, alias("__alloc_bootmem_huge_page")));
+int __alloc_bootmem_huge_page(struct hstate *h)
 {
        struct huge_bootmem_page *m;
        int nr_nodes, node;