diff options
author | Robin Holt <holt@sgi.com> | 2010-05-11 17:06:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-11 20:33:41 -0400 |
commit | 34441427aab4bdb3069a4ffcda69a99357abcb2e (patch) | |
tree | 3beebde910f25b0945e9105017fd743c9e5241a5 /fs/proc/task_mmu.c | |
parent | 3c904afd7358e9ef515eb5df36b6f25c2b7fc2da (diff) |
revert "procfs: provide stack information for threads" and its fixup commits
Originally, commit d899bf7b ("procfs: provide stack information for
threads") attempted to introduce a new feature for showing where the
threadstack was located and how many pages are being utilized by the
stack.
Commit c44972f1 ("procfs: disable per-task stack usage on NOMMU") was
applied to fix the NO_MMU case.
Commit 89240ba0 ("x86, fs: Fix x86 procfs stack information for threads on
64-bit") was applied to fix a bug in ia32 executables being loaded.
Commit 9ebd4eba7 ("procfs: fix /proc/<pid>/stat stack pointer for kernel
threads") was applied to fix a bug which had kernel threads printing a
userland stack address.
Commit 1306d603f ('proc: partially revert "procfs: provide stack
information for threads"') was then applied to revert the stack pages
being used to solve a significant performance regression.
This patch nearly undoes the effect of all these patches.
The reason for reverting these is it provides an unusable value in
field 28. For x86_64, a fork will result in the task->stack_start
value being updated to the current user top of stack and not the stack
start address. This unpredictability of the stack_start value makes
it worthless. That includes the intended use of showing how much stack
space a thread has.
Other architectures will get different values. As an example, ia64
gets 0. The do_fork() and copy_process() functions appear to treat the
stack_start and stack_size parameters as architecture specific.
I only partially reverted c44972f1 ("procfs: disable per-task stack usage
on NOMMU") . If I had completely reverted it, I would have had to change
mm/Makefile only build pagewalk.o when CONFIG_PROC_PAGE_MONITOR is
configured. Since I could not test the builds without significant effort,
I decided to not change mm/Makefile.
I only partially reverted 89240ba0 ("x86, fs: Fix x86 procfs stack
information for threads on 64-bit") . I left the KSTK_ESP() change in
place as that seemed worthwhile.
Signed-off-by: Robin Holt <holt@sgi.com>
Cc: Stefani Seibold <stefani@seibold.net>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/task_mmu.c')
-rw-r--r-- | fs/proc/task_mmu.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 070553427dd5..47f5b145f56e 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -247,25 +247,6 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma) | |||
247 | } else if (vma->vm_start <= mm->start_stack && | 247 | } else if (vma->vm_start <= mm->start_stack && |
248 | vma->vm_end >= mm->start_stack) { | 248 | vma->vm_end >= mm->start_stack) { |
249 | name = "[stack]"; | 249 | name = "[stack]"; |
250 | } else { | ||
251 | unsigned long stack_start; | ||
252 | struct proc_maps_private *pmp; | ||
253 | |||
254 | pmp = m->private; | ||
255 | stack_start = pmp->task->stack_start; | ||
256 | |||
257 | if (vma->vm_start <= stack_start && | ||
258 | vma->vm_end >= stack_start) { | ||
259 | pad_len_spaces(m, len); | ||
260 | seq_printf(m, | ||
261 | "[threadstack:%08lx]", | ||
262 | #ifdef CONFIG_STACK_GROWSUP | ||
263 | vma->vm_end - stack_start | ||
264 | #else | ||
265 | stack_start - vma->vm_start | ||
266 | #endif | ||
267 | ); | ||
268 | } | ||
269 | } | 250 | } |
270 | } else { | 251 | } else { |
271 | name = "[vdso]"; | 252 | name = "[vdso]"; |