aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@au1.ibm.com>2014-05-15 11:05:12 -0500
committerBadari Pulavarty <pbadari@ltcphx.austin.ibm.com>2014-05-15 11:05:12 -0500
commitb8e3a51439bb0fefb318d990c95001967f41b7dc (patch)
tree8954605cb18403cb27dc4f69e3e2839cd22fbf2d
parentb7b33876ec63e50620ab710f2e34c50ca7cb5541 (diff)
downloadpowerkvm-b8e3a51439bb0fefb318d990c95001967f41b7dc.tar.gz
KVM: PPC: Book3S HV: Reduce default CMA pool size
We have observed that on machines with all their memory in a single node, it is possible to hit an out of memory situation where kernel allocations (which can't use the CMA pool) fail, triggering the OOM killer, yet reclaim doesn't start because there is still free memory in the CMA pool. To alleviate this situation somewhat, this reduces the default CMA pool size from 5% to 3% of system memory. The 3% should still be enough in most situations, and if not, the user can specify a different amount on the kernel command line. This should help with BZ 110181. Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/kvm/book3s_hv_builtin.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c
index 4532996b561d18..1255dc8c98030b 100644
--- a/arch/powerpc/kvm/book3s_hv_builtin.c
+++ b/arch/powerpc/kvm/book3s_hv_builtin.c
@@ -29,9 +29,12 @@
*/
#define HPT_ALIGN_PAGES ((1 << 18) >> PAGE_SHIFT) /* 256k */
/*
- * By default we reserve 5% of memory for hash pagetable allocation.
+ * By default we reserve 3% of memory for hash pagetable allocation.
+ * Each guest's HPT will be sized at between 1/128 and 1/64 of its
+ * memory, i.e. up to 1.56%, and allowing for about a 2x memory
+ * overcommit factor gets us to about 3%.
*/
-static unsigned long kvm_cma_resv_ratio = 5;
+static unsigned long kvm_cma_resv_ratio = 3;
/*
* We allocate RMAs (real mode areas) for KVM guests from the KVM CMA area.
* Each RMA has to be physically contiguous and of a size that the