]> git.baikalelectronics.ru Git - kernel.git/commit
Don't lock guardpage if the stack is growing up
authorMikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Mon, 9 May 2011 11:01:09 +0000 (13:01 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 9 May 2011 23:22:07 +0000 (16:22 -0700)
commit14daa912a610d515c3d6fe9e3c74d245f2a01d27
tree9cb2ae1fef7083af91a49c19411e9871e0e59a37
parent9a97e1b5db40af9f3cd85d570c6b439d366a9e10
Don't lock guardpage if the stack is growing up

Linux kernel excludes guard page when performing mlock on a VMA with
down-growing stack. However, some architectures have up-growing stack
and locking the guard page should be excluded in this case too.

This patch fixes lvm2 on PA-RISC (and possibly other architectures with
up-growing stack). lvm2 calculates number of used pages when locking and
when unlocking and reports an internal error if the numbers mismatch.

[ Patch changed fairly extensively to also fix /proc/<pid>/maps for the
  grows-up case, and to move things around a bit to clean it all up and
  share the infrstructure with the /proc bits.

  Tested on ia64 that has both grow-up and grow-down segments  - Linus ]

Signed-off-by: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Tested-by: Tony Luck <tony.luck@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/task_mmu.c
include/linux/mm.h
mm/memory.c