From: Jeff Vanhoof Date: Thu, 19 Oct 2017 10:39:30 +0000 (-0500) Subject: lowmemorykiller:Account for extra_free_kbytes in calcuations X-Git-Tag: MMI-RSA31.Q1-48-36-11~166 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f70ae7798e5481d2ab348fa79938f2b2ea774040;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git lowmemorykiller:Account for extra_free_kbytes in calcuations Account for extra_free_kbytes in calcuations CRs-fixed: (CR) Signed-off-by: Jeff Vanhoof Change-Id: I2c44a1775d43fad40cf49d6303b7552c2c089b6e Reviewed-on: https://gerrit.mot.com/1076213 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Coverity Analysis Reviewed-by: Igor Kovalenko Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1318719 Reviewed-by: Dawei Wang Reviewed-by: Zhichao Chen --- diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index 224fd9a64c12..8f528262c35e 100644 --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers/staging/android/lowmemorykiller.c @@ -44,6 +44,8 @@ #include static u32 lowmem_debug_level = 1; +extern int extra_free_kbytes; + static short lowmem_adj[6] = { 0, 1, @@ -100,7 +102,8 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc) if (lowmem_minfree_size < array_size) array_size = lowmem_minfree_size; for (i = 0; i < array_size; i++) { - minfree = lowmem_minfree[i]; + minfree = lowmem_minfree[i] + + ((extra_free_kbytes * 1024) / PAGE_SIZE); if (other_free < minfree && other_file < minfree) { min_score_adj = lowmem_adj[i]; break;