diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2011-01-13 18:46:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:40 -0500 |
commit | 8ac1f8320a0073f28cf9e0491af4cd98f504f92a (patch) | |
tree | 4dad891c302587fdc7b099b18e05d7dbc5526c64 /include/linux/mm.h | |
parent | 64cc6ae001d70bc59e5f854e6b5678f59110df16 (diff) |
thp: pte alloc trans splitting
pte alloc routines must wait for split_huge_page if the pmd is not present
and not null (i.e. pmd_trans_splitting). The additional branches are
optimized away at compile time by pmd_trans_splitting if the config option
is off. However we must pass the vma down in order to know the anon_vma
lock to wait for.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 6bef67d74adf..14ddd98b063f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1131,7 +1131,8 @@ static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud, | |||
1131 | int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); | 1131 | int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); |
1132 | #endif | 1132 | #endif |
1133 | 1133 | ||
1134 | int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address); | 1134 | int __pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, |
1135 | pmd_t *pmd, unsigned long address); | ||
1135 | int __pte_alloc_kernel(pmd_t *pmd, unsigned long address); | 1136 | int __pte_alloc_kernel(pmd_t *pmd, unsigned long address); |
1136 | 1137 | ||
1137 | /* | 1138 | /* |
@@ -1200,16 +1201,18 @@ static inline void pgtable_page_dtor(struct page *page) | |||
1200 | pte_unmap(pte); \ | 1201 | pte_unmap(pte); \ |
1201 | } while (0) | 1202 | } while (0) |
1202 | 1203 | ||
1203 | #define pte_alloc_map(mm, pmd, address) \ | 1204 | #define pte_alloc_map(mm, vma, pmd, address) \ |
1204 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \ | 1205 | ((unlikely(pmd_none(*(pmd))) && __pte_alloc(mm, vma, \ |
1205 | NULL: pte_offset_map(pmd, address)) | 1206 | pmd, address))? \ |
1207 | NULL: pte_offset_map(pmd, address)) | ||
1206 | 1208 | ||
1207 | #define pte_alloc_map_lock(mm, pmd, address, ptlp) \ | 1209 | #define pte_alloc_map_lock(mm, pmd, address, ptlp) \ |
1208 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \ | 1210 | ((unlikely(pmd_none(*(pmd))) && __pte_alloc(mm, NULL, \ |
1211 | pmd, address))? \ | ||
1209 | NULL: pte_offset_map_lock(mm, pmd, address, ptlp)) | 1212 | NULL: pte_offset_map_lock(mm, pmd, address, ptlp)) |
1210 | 1213 | ||
1211 | #define pte_alloc_kernel(pmd, address) \ | 1214 | #define pte_alloc_kernel(pmd, address) \ |
1212 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc_kernel(pmd, address))? \ | 1215 | ((unlikely(pmd_none(*(pmd))) && __pte_alloc_kernel(pmd, address))? \ |
1213 | NULL: pte_offset_kernel(pmd, address)) | 1216 | NULL: pte_offset_kernel(pmd, address)) |
1214 | 1217 | ||
1215 | extern void free_area_init(unsigned long * zones_size); | 1218 | extern void free_area_init(unsigned long * zones_size); |