diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-11-11 08:27:11 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-11-11 08:27:11 +0100 |
commit | bfdd5537dcc857eaa04c055ef8afcb8a80dea831 (patch) | |
tree | 6336969fb04fcd0db4bcbef529f318a86dc9f7c8 /fs/proc/task_nommu.c | |
parent | sched/core: Explain sleep/wakeup in a better way (diff) | |
parent | Merge tag 'sound-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ti... (diff) | |
download | linux-bfdd5537dcc857eaa04c055ef8afcb8a80dea831.tar.xz linux-bfdd5537dcc857eaa04c055ef8afcb8a80dea831.zip |
Merge branch 'linus' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/proc/task_nommu.c')
-rw-r--r-- | fs/proc/task_nommu.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c index faacb0c0d857..37175621e890 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c @@ -124,25 +124,17 @@ unsigned long task_statm(struct mm_struct *mm, } static int is_stack(struct proc_maps_private *priv, - struct vm_area_struct *vma, int is_pid) + struct vm_area_struct *vma) { struct mm_struct *mm = vma->vm_mm; - int stack = 0; - - if (is_pid) { - stack = vma->vm_start <= mm->start_stack && - vma->vm_end >= mm->start_stack; - } else { - struct inode *inode = priv->inode; - struct task_struct *task; - - rcu_read_lock(); - task = pid_task(proc_pid(inode), PIDTYPE_PID); - if (task) - stack = vma_is_stack_for_task(vma, task); - rcu_read_unlock(); - } - return stack; + + /* + * We make no effort to guess what a given thread considers to be + * its "stack". It's not even well-defined for programs written + * languages like Go. + */ + return vma->vm_start <= mm->start_stack && + vma->vm_end >= mm->start_stack; } /* @@ -184,7 +176,7 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma, if (file) { seq_pad(m, ' '); seq_file_path(m, file, ""); - } else if (mm && is_stack(priv, vma, is_pid)) { + } else if (mm && is_stack(priv, vma)) { seq_pad(m, ' '); seq_printf(m, "[stack]"); } |