]> git.karo-electronics.de Git - karo-tx-linux.git/commit
thp, memcg: split hugepage for memcg oom on cow
authorDavid Rientjes <rientjes@google.com>
Thu, 3 May 2012 05:43:47 +0000 (15:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 3 May 2012 05:46:28 +0000 (15:46 +1000)
commitf4b8708286de928f5d93e6a503a455f0e51f9e7b
treedd3feaa55d13ff6e0c155b5f0cdcc6457ad5d413
parent9f645c61ba1a21a2959f91b78975120755212786
thp, memcg: split hugepage for memcg oom on cow

On COW, a new hugepage is allocated and charged to the memcg.  If the
system is oom or the charge to the memcg fails, however, the fault handler
will return VM_FAULT_OOM which results in an oom kill.

Instead, it's possible to fallback to splitting the hugepage so that the
COW results only in an order-0 page being allocated and charged to the
memcg which has a higher liklihood to succeed.  This is expensive because
the hugepage must be split in the page fault handler, but it is much
better than unnecessarily oom killing a process.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Johannes Weiner <jweiner@redhat.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c
mm/memory.c