Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263339
b: refs/heads/master
c: 23751be
h: refs/heads/master
i:
  263337: e1afdca
  263335: a8d79dc
v: v3
  • Loading branch information
Johannes Weiner authored and Linus Torvalds committed Aug 25, 2011
1 parent 3d2755f commit d1af67a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 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: 86383b55791bd97e88ef493e33ef521ee244f3d9
refs/heads/master: 23751be0094012eb6b4756fa80ca54b3eb83069f
17 changes: 5 additions & 12 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1841,29 +1841,23 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
*/
static bool mem_cgroup_oom_lock(struct mem_cgroup *mem)
{
int lock_count = -1;
struct mem_cgroup *iter, *failed = NULL;
bool cond = true;

for_each_mem_cgroup_tree_cond(iter, mem, cond) {
bool locked = iter->oom_lock;

iter->oom_lock = true;
if (lock_count == -1)
lock_count = iter->oom_lock;
else if (lock_count != locked) {
if (iter->oom_lock) {
/*
* this subtree of our hierarchy is already locked
* so we cannot give a lock.
*/
lock_count = 0;
failed = iter;
cond = false;
}
} else
iter->oom_lock = true;
}

if (!failed)
goto done;
return true;

/*
* OK, we failed to lock the whole subtree so we have to clean up
Expand All @@ -1877,8 +1871,7 @@ static bool mem_cgroup_oom_lock(struct mem_cgroup *mem)
}
iter->oom_lock = false;
}
done:
return lock_count;
return false;
}

/*
Expand Down

0 comments on commit d1af67a

Please sign in to comment.