Thread (14 messages) 14 messages, 5 authors, 2011-08-10

Re: [PATCH 1/2 v2] memcg: make oom_lock 0 and 1 based rather than coutner

From: Johannes Weiner <hidden>
Date: 2011-08-09 15:38:21
Also in: lkml
Subsystem: control group - memory resource controller (memcg), memory management, the rest · Maintainers: Johannes Weiner, Michal Hocko, Roman Gushchin, Shakeel Butt, Andrew Morton, Linus Torvalds

On Tue, Aug 09, 2011 at 05:22:18PM +0200, Michal Hocko wrote:
On Tue 09-08-11 16:03:12, Johannes Weiner wrote:
quoted
 	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)
We can return here and get rid of done label.
Ah, right you are.  Here is an update.

---
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help