aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/mm/hugetlbpage.c7
-rw-r--r--include/asm-ia64/page.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index 9dbc7dadd165..8d506710fdbd 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -113,8 +113,7 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb,
113 unsigned long floor, unsigned long ceiling) 113 unsigned long floor, unsigned long ceiling)
114{ 114{
115 /* 115 /*
116 * This is called only when is_hugepage_only_range(addr,), 116 * This is called to free hugetlb page tables.
117 * and it follows that is_hugepage_only_range(end,) also.
118 * 117 *
119 * The offset of these addresses from the base of the hugetlb 118 * The offset of these addresses from the base of the hugetlb
120 * region must be scaled down by HPAGE_SIZE/PAGE_SIZE so that 119 * region must be scaled down by HPAGE_SIZE/PAGE_SIZE so that
@@ -126,9 +125,9 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb,
126 125
127 addr = htlbpage_to_page(addr); 126 addr = htlbpage_to_page(addr);
128 end = htlbpage_to_page(end); 127 end = htlbpage_to_page(end);
129 if (is_hugepage_only_range(tlb->mm, floor, HPAGE_SIZE)) 128 if (REGION_NUMBER(floor) == RGN_HPAGE)
130 floor = htlbpage_to_page(floor); 129 floor = htlbpage_to_page(floor);
131 if (is_hugepage_only_range(tlb->mm, ceiling, HPAGE_SIZE)) 130 if (REGION_NUMBER(ceiling) == RGN_HPAGE)
132 ceiling = htlbpage_to_page(ceiling); 131 ceiling = htlbpage_to_page(ceiling);
133 132
134 free_pgd_range(tlb, addr, end, floor, ceiling); 133 free_pgd_range(tlb, addr, end, floor, ceiling);
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
index 3ab27333dae4..6e9aa23250c4 100644
--- a/include/asm-ia64/page.h
+++ b/include/asm-ia64/page.h
@@ -149,7 +149,7 @@ typedef union ia64_va {
149 | (REGION_OFFSET(x) >> (HPAGE_SHIFT-PAGE_SHIFT))) 149 | (REGION_OFFSET(x) >> (HPAGE_SHIFT-PAGE_SHIFT)))
150# define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) 150# define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
151# define is_hugepage_only_range(mm, addr, len) \ 151# define is_hugepage_only_range(mm, addr, len) \
152 (REGION_NUMBER(addr) == RGN_HPAGE && \ 152 (REGION_NUMBER(addr) == RGN_HPAGE || \
153 REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE) 153 REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE)
154extern unsigned int hpage_shift; 154extern unsigned int hpage_shift;
155#endif 155#endif