From 46d6a8d4fd3115a1a1043212d5d4999aaba1ebd3 Mon Sep 17 00:00:00 2001 From: David Rientjes Date: Tue, 16 Oct 2012 17:31:23 -0700 Subject: [PATCH] --- yaml --- r: 334351 b: refs/heads/master c: 32f8516a8c733d281faa9f6666b509035246505c h: refs/heads/master i: 334349: bc6cff187b8b9404a155327a28a135c71f7df4e9 334347: b95be3f4ae0d38fadc5b6ab3e41e4290df07e2c5 334343: 74aa6c83bcc57fc138d76679de5dd423fba76c02 334335: 5a9100354ca3efbcedce883e4211e6ed14ba6df1 v: v3 --- [refs] | 2 +- trunk/fs/proc/task_mmu.c | 7 +++++-- trunk/mm/mempolicy.c | 5 ++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index f02a715288bc..b41267003829 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: dd8e8c4a2c902d8350b702e7bc7c2799e5e7e331 +refs/heads/master: 32f8516a8c733d281faa9f6666b509035246505c diff --git a/trunk/fs/proc/task_mmu.c b/trunk/fs/proc/task_mmu.c index 79827ce03e3b..14df8806ff29 100644 --- a/trunk/fs/proc/task_mmu.c +++ b/trunk/fs/proc/task_mmu.c @@ -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; @@ -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); @@ -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 diff --git a/trunk/mm/mempolicy.c b/trunk/mm/mempolicy.c index 0b78fb9ea65b..d04a8a54c294 100644 --- a/trunk/mm/mempolicy.c +++ b/trunk/mm/mempolicy.c @@ -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