From e0f03516109881263fe86fc97d42d3ec6ae75155 Mon Sep 17 00:00:00 2001 From: Dan Crowell Date: Tue, 12 Mar 2019 13:40:29 -0500 Subject: Tweak page eviction parameters to handle low mem better We are memory constrained in some configurations during 10.2 because we are forced to pin large chunks of memory to hold a few data partitions. In some instances we have run out of free memory completely. The fact that we don't hit this all the time indicates it is purely based on timing and the random nature of page allocations. A few changes were made to better handle these kinds of low memory situations: - Any time we dip into the kernel's private stash of free pages we will force memory periodics to run. This should free up some pages so that the kernel's stash can remain full. - The size of the kernel's private page stash is increased from 4 to 10. We need this larger number due to the increased layers involved in paging code in/out with secureboot enabled. - The LRU algorithm was modified to keep pages around longer. A page will not be evicted under normal circumstances until we go 10 refresh cycles without an access (up from 3). This should help balance out the increased number of forced periodics that could now come into play. Change-Id: I289d866270db9d70cac275d8c98ab185caaade05 CQ: SW458623 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/73189 Reviewed-by: Nicholas E. Bofferding Reviewed-by: Matt Derksen Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Tested-by: Jenkins OP HW Reviewed-by: Daniel M. Crowell --- src/include/kernel/pagemgr.H | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/include') diff --git a/src/include/kernel/pagemgr.H b/src/include/kernel/pagemgr.H index 7b5deddb4..d2500601f 100644 --- a/src/include/kernel/pagemgr.H +++ b/src/include/kernel/pagemgr.H @@ -188,14 +188,18 @@ class PageManager enum { - KERNEL_HEAP_RESERVED_PAGES = 4, + // Always keep this many free pages for the kernel to use + KERNEL_HEAP_RESERVED_PAGES = 10, + // Triggers a NORMAL page castout #ifdef CONFIG_P9_VPO_COMPILE // VPO has constrained mem env -> higher threshold LOWMEM_NORM_LIMIT = 32, #else LOWMEM_NORM_LIMIT = 16, #endif - LOWMEM_CRIT_LIMIT = 5, + + // Triggers CRITICAL page castout + LOWMEM_CRIT_LIMIT = KERNEL_HEAP_RESERVED_PAGES+1, }; static size_t cv_coalesce_count; //!< running coalesced counter -- cgit v1.2.3