diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2013-11-14 17:30:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 19:32:14 -0500 |
commit | e1f56c89b040134add93f686931cc266541d239a (patch) | |
tree | 36efea76d1803cca3e2a7716850d872db70afd8f /mm/oom_kill.c | |
parent | 57c1ffcefb5acb3c8b5f8436c325a6bdbd8e9c78 (diff) |
mm: convert mm->nr_ptes to atomic_long_t
With split page table lock for PMD level we can't hold mm->page_table_lock
while updating nr_ptes.
Let's convert it to atomic_long_t to avoid races.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Tested-by: Alex Thorlton <athorlton@sgi.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: "Eric W . Biederman" <ebiederm@xmission.com>
Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Dave Jones <davej@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Robin Holt <robinmholt@gmail.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r-- | mm/oom_kill.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 6738c47f1f72..1e4a600a6163 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -161,7 +161,7 @@ unsigned long oom_badness(struct task_struct *p, struct mem_cgroup *memcg, | |||
161 | * The baseline for the badness score is the proportion of RAM that each | 161 | * The baseline for the badness score is the proportion of RAM that each |
162 | * task's rss, pagetable and swap space use. | 162 | * task's rss, pagetable and swap space use. |
163 | */ | 163 | */ |
164 | points = get_mm_rss(p->mm) + p->mm->nr_ptes + | 164 | points = get_mm_rss(p->mm) + atomic_long_read(&p->mm->nr_ptes) + |
165 | get_mm_counter(p->mm, MM_SWAPENTS); | 165 | get_mm_counter(p->mm, MM_SWAPENTS); |
166 | task_unlock(p); | 166 | task_unlock(p); |
167 | 167 | ||
@@ -364,10 +364,10 @@ static void dump_tasks(const struct mem_cgroup *memcg, const nodemask_t *nodemas | |||
364 | continue; | 364 | continue; |
365 | } | 365 | } |
366 | 366 | ||
367 | pr_info("[%5d] %5d %5d %8lu %8lu %7lu %8lu %5hd %s\n", | 367 | pr_info("[%5d] %5d %5d %8lu %8lu %7ld %8lu %5hd %s\n", |
368 | task->pid, from_kuid(&init_user_ns, task_uid(task)), | 368 | task->pid, from_kuid(&init_user_ns, task_uid(task)), |
369 | task->tgid, task->mm->total_vm, get_mm_rss(task->mm), | 369 | task->tgid, task->mm->total_vm, get_mm_rss(task->mm), |
370 | task->mm->nr_ptes, | 370 | atomic_long_read(&task->mm->nr_ptes), |
371 | get_mm_counter(task->mm, MM_SWAPENTS), | 371 | get_mm_counter(task->mm, MM_SWAPENTS), |
372 | task->signal->oom_score_adj, task->comm); | 372 | task->signal->oom_score_adj, task->comm); |
373 | task_unlock(task); | 373 | task_unlock(task); |