Re: [patch -mm 7/5] oom: filter tasklist dump by mem_cgroup
From: David Rientjes <rientjes@google.com>
Date: 2007-09-26 04:24:11
On Tue, 25 Sep 2007, David Rientjes wrote:
void dump_tasks(const struct mem_cgroup *mem)
{
struct task_struct *g, *p;
do_each_thread(g, p) {
...
if (!task_in_mem_cgroup(p, mem)
continue;
if (!cpuset_mems_allowed_intersects(current, p))
continue;
/* show the task information */
} while_each_thread(g, p);
}By the way, the only reason I didn't code it like this was because tasks that overlap nodes in mems_allowed with the OOM-triggering task aren't necessarily excluded from being OOM killed, as I mentioned. In other words, coding it like the above opens up the possibility of filtering the task that ends up getting killed. Not a good idea. Tasks that aren't in the same mem_cgroup, however, are filtered from the dump because they are explicitly excluded from being a target. The check for that is actually misplaced and currently appears in badness() when it should appear in select_bad_process(). -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>