Re: [patch -mm 4/9 v2] oom: remove compulsory panic_on_oom mode
From: David Rientjes
Date: Mon Feb 22 2010 - 15:56:13 EST
On Mon, 22 Feb 2010, KAMEZAWA Hiroyuki wrote:
> Essential fix is better. The best fix is don't call oom-killer in
> pagefault_out_of_memory. So, returning other than VM_FAULT_OOM is
> the best, I think. But hmm...we don't have VM_FAULT_AGAIN etc..
> So, please avoid quick fix.
>
The last patch in my oom killer series defaults pagefault_out_of_memory()
to always kill current first, if it's killable. If it is unsuccessful, we
fallback to scanning the entire tasklist.
For tasks that are constrained by a memcg, we could probably use
mem_cgroup_from_task(current) and if it's non-NULL and non-root, call
mem_cgroup_out_of_memory() with a gfp_mask of 0. That would at least
penalize the same memcg instead of invoking a global oom and would try the
additional logic that you plan on adding to avoid killing any task at all
in such conditions.
--
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/