Messages in this thread | | | Date | Mon, 22 Feb 2010 12:55:57 -0800 (PST) | From | David Rientjes <> | Subject | Re: [patch -mm 4/9 v2] oom: remove compulsory panic_on_oom mode |
| |
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.
| |