blob: 76dbaa037eba978c39b0a1e41a1b5cd57144b3f5 [file] [log] [blame]
From c3d39745906c93ddd69dadf2e47614b41ac4a823 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Wed, 9 Dec 2009 22:25:28 +0100
Subject: [PATCH] oom: Add missing rcu protection of __task_cred() in dump_tasks
commit 57bba6a44244a9c7cef5951041bdd3f747b28ed0 in tip.
dump_tasks accesses __task_cred() without being in a RCU read side
critical section. tasklist_lock is not protecting that when
CONFIG_TREE_PREEMPT_RCU=y.
Add a rcu_read_lock/unlock() section around the code which accesses
__task_cred().
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mm@kvack.org
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 2370504..9210595 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -349,7 +349,7 @@ static void dump_tasks(const struct mem_cgroup *mem)
continue;
}
printk(KERN_INFO "[%5d] %5d %5d %8lu %8lu %3d %3d %s\n",
- p->pid, __task_cred(p)->uid, p->tgid, mm->total_vm,
+ p->pid, task_uid(p), p->tgid, mm->total_vm,
get_mm_rss(mm), (int)task_cpu(p), p->signal->oom_adj,
p->comm);
task_unlock(p);
--
1.7.1.1