diff options
author | Hugh Dickins <hugh@veritas.com> | 2005-10-29 21:16:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 00:40:40 -0400 |
commit | 1bb3630e89cb8a7b3d3807629c20c5bad88290ff (patch) | |
tree | 3d1fd73487ca66f227701b9530f2c76fcc6f9da4 /include/asm-generic | |
parent | 872fec16d9a0ed3b75b8893aa217e49cca575ee5 (diff) |
[PATCH] mm: ptd_alloc inline and out
It seems odd to me that, whereas pud_alloc and pmd_alloc test inline, only
calling out-of-line __pud_alloc __pmd_alloc if allocation needed,
pte_alloc_map and pte_alloc_kernel are entirely out-of-line. Though it does
add a little to kernel size, change them to macros testing inline, calling
__pte_alloc or __pte_alloc_kernel to allocate out-of-line. Mark none of them
as fastcalls, leave that to CONFIG_REGPARM or not.
It also seems more natural for the out-of-line functions to leave the offset
calculation and map to the inline, which has to do it anyway for the common
case. At least mremap move wants __pte_alloc without _map.
Macros rather than inline functions, certainly to avoid the header file issues
which arise from CONFIG_HIGHPTE needing kmap_types.h, but also in case any
architectures I haven't built would have other such problems.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/4level-fixup.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h index c20ec257ecc0..68c6fea994d9 100644 --- a/include/asm-generic/4level-fixup.h +++ b/include/asm-generic/4level-fixup.h | |||
@@ -10,14 +10,9 @@ | |||
10 | 10 | ||
11 | #define pud_t pgd_t | 11 | #define pud_t pgd_t |
12 | 12 | ||
13 | #define pmd_alloc(mm, pud, address) \ | 13 | #define pmd_alloc(mm, pud, address) \ |
14 | ({ pmd_t *ret; \ | 14 | ((unlikely(pgd_none(*(pud))) && __pmd_alloc(mm, pud, address))? \ |
15 | if (pgd_none(*pud)) \ | 15 | NULL: pmd_offset(pud, address)) |
16 | ret = __pmd_alloc(mm, pud, address); \ | ||
17 | else \ | ||
18 | ret = pmd_offset(pud, address); \ | ||
19 | ret; \ | ||
20 | }) | ||
21 | 16 | ||
22 | #define pud_alloc(mm, pgd, address) (pgd) | 17 | #define pud_alloc(mm, pgd, address) (pgd) |
23 | #define pud_offset(pgd, start) (pgd) | 18 | #define pud_offset(pgd, start) (pgd) |