Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208523
b: refs/heads/master
c: 158e0a2
h: refs/heads/master
i:
  208521: c3b9a23
  208519: 572abb6
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Aug 11, 2010
1 parent fe0d248 commit 28606c8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 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: 73045c47b6facbdf4656e6763c8cb469de4337e2
refs/heads/master: 158e0a2d1b3cffed8b46cbc56393a1394672ef79
2 changes: 2 additions & 0 deletions trunk/include/linux/oom.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ static inline void oom_killer_enable(void)
extern unsigned long badness(struct task_struct *p, struct mem_cgroup *mem,
const nodemask_t *nodemask, unsigned long uptime);

extern struct task_struct *find_lock_task_mm(struct task_struct *p);

/* sysctls */
extern int sysctl_oom_dump_tasks;
extern int sysctl_oom_kill_allocating_task;
Expand Down
10 changes: 7 additions & 3 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <linux/mm_inline.h>
#include <linux/page_cgroup.h>
#include <linux/cpu.h>
#include <linux/oom.h>
#include "internal.h"

#include <asm/uaccess.h>
Expand Down Expand Up @@ -838,10 +839,13 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem)
{
int ret;
struct mem_cgroup *curr = NULL;
struct task_struct *p;

task_lock(task);
curr = try_get_mem_cgroup_from_mm(task->mm);
task_unlock(task);
p = find_lock_task_mm(task);
if (!p)
return 0;
curr = try_get_mem_cgroup_from_mm(p->mm);
task_unlock(p);
if (!curr)
return 0;
/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static void boost_dying_task_prio(struct task_struct *p,
* pointer. Return p, or any of its subthreads with a valid ->mm, with
* task_lock() held.
*/
static struct task_struct *find_lock_task_mm(struct task_struct *p)
struct task_struct *find_lock_task_mm(struct task_struct *p)
{
struct task_struct *t = p;

Expand Down

0 comments on commit 28606c8

Please sign in to comment.