/[linux-patches]/genpatches-2.6/trunk/2.6.12-pre/1110_aio-hugepage.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.12-pre/1110_aio-hugepage.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (show annotations) (download) (as text)
Sat Jun 11 23:20:41 2005 UTC (15 years, 5 months ago) by dsd
File MIME type: text/x-diff
File size: 5362 byte(s)
Create 2.6.12 branch
1 diff -urNpX dontdiff linux-2.6.11-gentoo-r10/arch/ppc64/mm/hugetlbpage.c linux-dsd/arch/ppc64/mm/hugetlbpage.c
2 --- linux-2.6.11-gentoo-r10/arch/ppc64/mm/hugetlbpage.c 2005-03-02 07:38:09.000000000 +0000
3 +++ linux-dsd/arch/ppc64/mm/hugetlbpage.c 2005-06-01 16:12:49.000000000 +0100
4 @@ -512,7 +512,7 @@ unsigned long arch_get_unmapped_area(str
5 vma = find_vma(mm, addr);
6 if (((TASK_SIZE - len) >= addr)
7 && (!vma || (addr+len) <= vma->vm_start)
8 - && !is_hugepage_only_range(addr,len))
9 + && !is_hugepage_only_range(mm, addr,len))
10 return addr;
11 }
12 start_addr = addr = mm->free_area_cache;
13 @@ -522,7 +522,7 @@ full_search:
14 while (TASK_SIZE - len >= addr) {
15 BUG_ON(vma && (addr >= vma->vm_end));
16
17 - if (touches_hugepage_low_range(addr, len)) {
18 + if (touches_hugepage_low_range(mm, addr, len)) {
19 addr = ALIGN(addr+1, 1<<SID_SHIFT);
20 vma = find_vma(mm, addr);
21 continue;
22 @@ -583,7 +583,7 @@ arch_get_unmapped_area_topdown(struct fi
23 vma = find_vma(mm, addr);
24 if (TASK_SIZE - len >= addr &&
25 (!vma || addr + len <= vma->vm_start)
26 - && !is_hugepage_only_range(addr,len))
27 + && !is_hugepage_only_range(mm, addr,len))
28 return addr;
29 }
30
31 @@ -596,7 +596,7 @@ try_again:
32 addr = (mm->free_area_cache - len) & PAGE_MASK;
33 do {
34 hugepage_recheck:
35 - if (touches_hugepage_low_range(addr, len)) {
36 + if (touches_hugepage_low_range(mm, addr, len)) {
37 addr = (addr & ((~0) << SID_SHIFT)) - len;
38 goto hugepage_recheck;
39 } else if (touches_hugepage_high_range(addr, len)) {
40 diff -urNpX dontdiff linux-2.6.11-gentoo-r10/include/asm-ia64/page.h linux-dsd/include/asm-ia64/page.h
41 --- linux-2.6.11-gentoo-r10/include/asm-ia64/page.h 2005-03-02 07:37:48.000000000 +0000
42 +++ linux-dsd/include/asm-ia64/page.h 2005-06-01 16:12:49.000000000 +0100
43 @@ -137,7 +137,7 @@ typedef union ia64_va {
44 # define htlbpage_to_page(x) (((unsigned long) REGION_NUMBER(x) << 61) \
45 | (REGION_OFFSET(x) >> (HPAGE_SHIFT-PAGE_SHIFT)))
46 # define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
47 -# define is_hugepage_only_range(addr, len) \
48 +# define is_hugepage_only_range(mm, addr, len) \
49 (REGION_NUMBER(addr) == REGION_HPAGE && \
50 REGION_NUMBER((addr)+(len)) == REGION_HPAGE)
51 extern unsigned int hpage_shift;
52 diff -urNpX dontdiff linux-2.6.11-gentoo-r10/include/asm-ppc64/page.h linux-dsd/include/asm-ppc64/page.h
53 --- linux-2.6.11-gentoo-r10/include/asm-ppc64/page.h 2005-03-02 07:37:30.000000000 +0000
54 +++ linux-dsd/include/asm-ppc64/page.h 2005-06-01 16:12:49.000000000 +0100
55 @@ -48,8 +48,8 @@
56 #define ARCH_HAS_HUGEPAGE_ONLY_RANGE
57 #define ARCH_HAS_PREPARE_HUGEPAGE_RANGE
58
59 -#define touches_hugepage_low_range(addr, len) \
60 - (LOW_ESID_MASK((addr), (len)) & current->mm->context.htlb_segs)
61 +#define touches_hugepage_low_range(mm, addr, len) \
62 + (LOW_ESID_MASK((addr), (len)) & mm->context.htlb_segs)
63 #define touches_hugepage_high_range(addr, len) \
64 (((addr) > (TASK_HPAGE_BASE-(len))) && ((addr) < TASK_HPAGE_END))
65
66 @@ -61,9 +61,9 @@
67 #define within_hugepage_high_range(addr, len) (((addr) >= TASK_HPAGE_BASE) \
68 && ((addr)+(len) <= TASK_HPAGE_END) && ((addr)+(len) >= (addr)))
69
70 -#define is_hugepage_only_range(addr, len) \
71 +#define is_hugepage_only_range(mm, addr, len) \
72 (touches_hugepage_high_range((addr), (len)) || \
73 - touches_hugepage_low_range((addr), (len)))
74 + touches_hugepage_low_range((mm), (addr), (len)))
75 #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
76
77 #define in_hugepage_area(context, addr) \
78 diff -urNpX dontdiff linux-2.6.11-gentoo-r10/include/linux/hugetlb.h linux-dsd/include/linux/hugetlb.h
79 --- linux-2.6.11-gentoo-r10/include/linux/hugetlb.h 2005-03-02 07:38:09.000000000 +0000
80 +++ linux-dsd/include/linux/hugetlb.h 2005-06-01 16:12:49.000000000 +0100
81 @@ -36,7 +36,7 @@ extern const unsigned long hugetlb_zero,
82 extern int sysctl_hugetlb_shm_group;
83
84 #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE
85 -#define is_hugepage_only_range(addr, len) 0
86 +#define is_hugepage_only_range(mm, addr, len) 0
87 #define hugetlb_free_pgtables(tlb, prev, start, end) do { } while (0)
88 #endif
89
90 @@ -71,7 +71,7 @@ static inline unsigned long hugetlb_tota
91 #define is_aligned_hugepage_range(addr, len) 0
92 #define prepare_hugepage_range(addr, len) (-EINVAL)
93 #define pmd_huge(x) 0
94 -#define is_hugepage_only_range(addr, len) 0
95 +#define is_hugepage_only_range(mm, addr, len) 0
96 #define hugetlb_free_pgtables(tlb, prev, start, end) do { } while (0)
97 #define alloc_huge_page() ({ NULL; })
98 #define free_huge_page(p) ({ (void)(p); BUG(); })
99 diff -urNpX dontdiff linux-2.6.11-gentoo-r10/mm/mmap.c linux-dsd/mm/mmap.c
100 --- linux-2.6.11-gentoo-r10/mm/mmap.c 2005-06-01 16:00:38.000000000 +0100
101 +++ linux-dsd/mm/mmap.c 2005-06-01 16:13:27.000000000 +0100
102 @@ -1344,7 +1344,7 @@ get_unmapped_area(struct file *file, uns
103 * reserved hugepage range. For some archs like IA-64,
104 * there is a separate region for hugepages.
105 */
106 - ret = is_hugepage_only_range(addr, len);
107 + ret = is_hugepage_only_range(current->mm, addr, len);
108 }
109 if (ret)
110 return -EINVAL;
111 @@ -1710,7 +1710,7 @@ static void unmap_region(struct mm_struc
112 unmap_vmas(&tlb, mm, vma, start, end, &nr_accounted, NULL);
113 vm_unacct_memory(nr_accounted);
114
115 - if (is_hugepage_only_range(start, end - start))
116 + if (is_hugepage_only_range(mm, start, end - start))
117 hugetlb_free_pgtables(tlb, prev, start, end);
118 else
119 free_pgtables(tlb, prev, start, end);

  ViewVC Help
Powered by ViewVC 1.1.20