[IA64] fix ia64 is_hugepage_only_range
authorChen, Kenneth W <kenneth.w.chen@intel.com>
Wed, 22 Mar 2006 18:49:00 +0000 (10:49 -0800)
committerTony Luck <tony.luck@intel.com>
Wed, 22 Mar 2006 22:35:08 +0000 (14:35 -0800)
fix is_hugepage_only_range() definition to be "overlaps"
instead of "within architectural restricted hugetlb address
range".  Simplify the ia64 specific code that used to use
is_hugepage_only_range() to just check which region the
address is in.

Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
arch/ia64/mm/hugetlbpage.c
include/asm-ia64/page.h

index 9dbc7dadd1653a79b078fa1b79f1e43266db84db..8d506710fdbd721f82c88aac5f9f5a20bae13b59 100644 (file)
@@ -113,8 +113,7 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb,
                        unsigned long floor, unsigned long ceiling)
 {
        /*
-        * This is called only when is_hugepage_only_range(addr,),
-        * and it follows that is_hugepage_only_range(end,) also.
+        * This is called to free hugetlb page tables.
         *
         * The offset of these addresses from the base of the hugetlb
         * 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,
 
        addr = htlbpage_to_page(addr);
        end  = htlbpage_to_page(end);
-       if (is_hugepage_only_range(tlb->mm, floor, HPAGE_SIZE))
+       if (REGION_NUMBER(floor) == RGN_HPAGE)
                floor = htlbpage_to_page(floor);
-       if (is_hugepage_only_range(tlb->mm, ceiling, HPAGE_SIZE))
+       if (REGION_NUMBER(ceiling) == RGN_HPAGE)
                ceiling = htlbpage_to_page(ceiling);
 
        free_pgd_range(tlb, addr, end, floor, ceiling);
index 3ab27333dae4c12fba4eaebbc3680d561e81f276..6e9aa23250c42d1ba127d5eb2d22b79c83735bc9 100644 (file)
@@ -149,7 +149,7 @@ typedef union ia64_va {
                                 | (REGION_OFFSET(x) >> (HPAGE_SHIFT-PAGE_SHIFT)))
 # define HUGETLB_PAGE_ORDER    (HPAGE_SHIFT - PAGE_SHIFT)
 # define is_hugepage_only_range(mm, addr, len)         \
-        (REGION_NUMBER(addr) == RGN_HPAGE &&   \
+        (REGION_NUMBER(addr) == RGN_HPAGE ||   \
          REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE)
 extern unsigned int hpage_shift;
 #endif