mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
memcontrol: move oom task exclusion to tasklist scan
Creates a helper function to return non-zero if a task is a member of a memory controller: int task_in_mem_cgroup(const struct task_struct *task, const struct mem_cgroup *mem); When the OOM killer is constrained by the memory controller, the exclusion of tasks that are not a member of that controller was previously misplaced and appeared in the badness scoring function. It should be excluded during the tasklist scan in select_bad_process() instead. [akpm@linux-foundation.org: build fix] Cc: Christoph Lameter <clameter@sgi.com> Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
4c6bc8dd5a
commit
4c4a221489
3 changed files with 19 additions and 7 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue