]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - mm/memcontrol.c
memcontrol: move oom task exclusion to tasklist scan
[~shefty/rdma-dev.git] / mm / memcontrol.c
index f6cdbf755ed30fcf5b78d08dd257d1e8520615a3..2fadd4896a1498a755901744f3c59e40dbebc4e7 100644 (file)
@@ -170,6 +170,16 @@ static void __mem_cgroup_move_lists(struct page_cgroup *pc, bool active)
                list_move(&pc->lru, &pc->mem_cgroup->inactive_list);
 }
 
+int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem)
+{
+       int ret;
+
+       task_lock(task);
+       ret = task->mm && mm_cgroup(task->mm) == mem;
+       task_unlock(task);
+       return ret;
+}
+
 /*
  * This routine assumes that the appropriate zone's lru lock is already held
  */