]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/hugetlb.c
x86/paravirt: make arch_flush_lazy_mmu/cpu disable preemption
[linux-2.6-omap-h63xx.git] / mm / hugetlb.c
index 5cb8bc7c80f709a8213309b9617c4a396854f057..618e98304080a8bdb3ace929c8dcb8938662fad4 100644 (file)
@@ -235,6 +235,19 @@ unsigned long vma_kernel_pagesize(struct vm_area_struct *vma)
        return 1UL << (hstate->order + PAGE_SHIFT);
 }
 
+/*
+ * Return the page size being used by the MMU to back a VMA. In the majority
+ * of cases, the page size used by the kernel matches the MMU size. On
+ * architectures where it differs, an architecture-specific version of this
+ * function is required.
+ */
+#ifndef vma_mmu_pagesize
+unsigned long vma_mmu_pagesize(struct vm_area_struct *vma)
+{
+       return vma_kernel_pagesize(vma);
+}
+#endif
+
 /*
  * Flags for MAP_PRIVATE reservations.  These are stored in the bottom
  * bits of the reservation map pointer, which are always clear due to
@@ -387,8 +400,10 @@ static void clear_huge_page(struct page *page,
 {
        int i;
 
-       if (unlikely(sz > MAX_ORDER_NR_PAGES))
-               return clear_gigantic_page(page, addr, sz);
+       if (unlikely(sz > MAX_ORDER_NR_PAGES)) {
+               clear_gigantic_page(page, addr, sz);
+               return;
+       }
 
        might_sleep();
        for (i = 0; i < sz/PAGE_SIZE; i++) {
@@ -420,8 +435,10 @@ static void copy_huge_page(struct page *dst, struct page *src,
        int i;
        struct hstate *h = hstate_vma(vma);
 
-       if (unlikely(pages_per_huge_page(h) > MAX_ORDER_NR_PAGES))
-               return copy_gigantic_page(dst, src, addr, vma);
+       if (unlikely(pages_per_huge_page(h) > MAX_ORDER_NR_PAGES)) {
+               copy_gigantic_page(dst, src, addr, vma);
+               return;
+       }
 
        might_sleep();
        for (i = 0; i < pages_per_huge_page(h); i++) {
@@ -988,7 +1005,7 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma,
        return page;
 }
 
-__attribute__((weak)) int alloc_bootmem_huge_page(struct hstate *h)
+int __weak alloc_bootmem_huge_page(struct hstate *h)
 {
        struct huge_bootmem_page *m;
        int nr_nodes = nodes_weight(node_online_map);
@@ -1007,8 +1024,7 @@ __attribute__((weak)) int alloc_bootmem_huge_page(struct hstate *h)
                         * puts them into the mem_map).
                         */
                        m = addr;
-                       if (m)
-                               goto found;
+                       goto found;
                }
                hstate_next_node(h);
                nr_nodes--;