summaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f6cdbf755ed3..2fadd4896a14 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -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
*/
OpenPOWER on IntegriCloud