Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334351
b: refs/heads/master
c: 32f8516
h: refs/heads/master
i:
  334349: bc6cff1
  334347: b95be3f
  334343: 74aa6c8
  334335: 5a91003
v: v3
  • Loading branch information
David Rientjes authored and Linus Torvalds committed Oct 17, 2012
1 parent 05129f4 commit 46d6a8d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dd8e8c4a2c902d8350b702e7bc7c2799e5e7e331
refs/heads/master: 32f8516a8c733d281faa9f6666b509035246505c
7 changes: 5 additions & 2 deletions trunk/fs/proc/task_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
struct vm_area_struct *vma = v;
struct numa_maps *md = &numa_priv->md;
struct file *file = vma->vm_file;
struct task_struct *task = proc_priv->task;
struct mm_struct *mm = vma->vm_mm;
struct mm_walk walk = {};
struct mempolicy *pol;
Expand All @@ -1177,9 +1178,11 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
walk.private = md;
walk.mm = mm;

pol = get_vma_policy(proc_priv->task, vma, vma->vm_start);
task_lock(task);
pol = get_vma_policy(task, vma, vma->vm_start);
mpol_to_str(buffer, sizeof(buffer), pol, 0);
mpol_cond_put(pol);
task_unlock(task);

seq_printf(m, "%08lx %s", vma->vm_start, buffer);

Expand All @@ -1189,7 +1192,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
} else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) {
seq_printf(m, " heap");
} else {
pid_t tid = vm_is_stack(proc_priv->task, vma, is_pid);
pid_t tid = vm_is_stack(task, vma, is_pid);
if (tid != 0) {
/*
* Thread stack in /proc/PID/task/TID/maps or
Expand Down
5 changes: 2 additions & 3 deletions trunk/mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1536,9 +1536,8 @@ asmlinkage long compat_sys_mbind(compat_ulong_t start, compat_ulong_t len,
*
* Returns effective policy for a VMA at specified address.
* Falls back to @task or system default policy, as necessary.
* Current or other task's task mempolicy and non-shared vma policies
* are protected by the task's mmap_sem, which must be held for read by
* the caller.
* Current or other task's task mempolicy and non-shared vma policies must be
* protected by task_lock(task) by the caller.
* Shared policies [those marked as MPOL_F_SHARED] require an extra reference
* count--added by the get_policy() vm_op, as appropriate--to protect against
* freeing by another task. It is the caller's responsibility to free the
Expand Down

0 comments on commit 46d6a8d

Please sign in to comment.