aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2005-10-29 21:16:20 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 00:40:39 -0400
commit46dea3d092d23a58b42499cc8a21de0fad079f4a (patch)
tree6ca46fb09d18e8ea51a354a1494cc742fcf2f2e7 /mm
parentf449952bc8bde7fbc73c6d20dff92b627a21f8b9 (diff)
[PATCH] mm: ia64 use expand_upwards
ia64 has expand_backing_store function for growing its Register Backing Store vma upwards. But more complete code for this purpose is found in the CONFIG_STACK_GROWSUP part of mm/mmap.c. Uglify its #ifdefs further to provide expand_upwards for ia64 as well as expand_stack for parisc. The Register Backing Store vma should be marked VM_ACCOUNT. Implement the intention of growing it only a page at a time, instead of passing an address outside of the vma to handle_mm_fault, with unknown consequences. 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 'mm')
-rw-r--r--mm/mmap.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index c43b28457007..d931d7e49ac9 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1508,11 +1508,15 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un
1508 return 0; 1508 return 0;
1509} 1509}
1510 1510
1511#ifdef CONFIG_STACK_GROWSUP 1511#if defined(CONFIG_STACK_GROWSUP) || defined(CONFIG_IA64)
1512/* 1512/*
1513 * vma is the first one with address > vma->vm_end. Have to extend vma. 1513 * PA-RISC uses this for its stack; IA64 for its Register Backing Store.
1514 * vma is the last one with address > vma->vm_end. Have to extend vma.
1514 */ 1515 */
1515int expand_stack(struct vm_area_struct * vma, unsigned long address) 1516#ifdef CONFIG_STACK_GROWSUP
1517static inline
1518#endif
1519int expand_upwards(struct vm_area_struct *vma, unsigned long address)
1516{ 1520{
1517 int error; 1521 int error;
1518 1522
@@ -1550,6 +1554,13 @@ int expand_stack(struct vm_area_struct * vma, unsigned long address)
1550 anon_vma_unlock(vma); 1554 anon_vma_unlock(vma);
1551 return error; 1555 return error;
1552} 1556}
1557#endif /* CONFIG_STACK_GROWSUP || CONFIG_IA64 */
1558
1559#ifdef CONFIG_STACK_GROWSUP
1560int expand_stack(struct vm_area_struct *vma, unsigned long address)
1561{
1562 return expand_upwards(vma, address);
1563}
1553 1564
1554struct vm_area_struct * 1565struct vm_area_struct *
1555find_extend_vma(struct mm_struct *mm, unsigned long addr) 1566find_extend_vma(struct mm_struct *mm, unsigned long addr)