Re: [patch -mm 4/9 v2] oom: remove compulsory panic_on_oom mode

From: David Rientjes
Date: Mon Feb 22 2010 - 15:59:30 EST


On Mon, 22 Feb 2010, Daisuke Nishimura wrote:

> hmm, I can agree with you. But I think we need some trick to distinguish normal VM_FAULT_OOM
> and memcg's VM_FAULT_OOM(the current itself was killed by memcg's oom, so exited the retry)
> at mem_cgroup_oom_called() to avoid the system from panic when panic_on_oom is enabled.
> (Mark the task which is being killed by memcg's oom ?).
>

pagefault_out_of_memory() should use mem_cgroup_from_task(current) and
then call mem_cgroup_out_of_memory() when it's non-NULL.
select_bad_process() will return ERR_PTR(-1UL) if there is an already oom
killed task attached to the memcg, so we can use that to avoid the
panic_on_oom. The setting of that sysctl doesn't imply that we can't scan
the tasklist, it simply means we can't kill anything as a result of an
oom.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/