From bf459bce2cdcb05b2f18bdc24321f81ef309916c Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Tue, 26 Mar 2019 22:34:21 -0700 Subject: [PATCH] mm: Boost when memory pressure becomes high When memory pressure starts to balloon, allocation latency takes a hit as the page allocator continuously tries to find a way to free up some pages. Boosting when this occurs can significantly help reduce allocation latency, preventing noticeable lag from being observed. Signed-off-by: Sultan Alsawaf Signed-off-by: Yaroslav Furman Signed-off-by: UtsavBalar1231 --- mm/page_alloc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d05af3e672b1..ad1c46ea9a2d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -69,6 +69,8 @@ #include #include #include +#include +#include #include #include @@ -4213,6 +4215,10 @@ retry: if (costly_order && !(gfp_mask & __GFP_RETRY_MAYFAIL)) goto nopage; + /* Boost when memory is low so allocation latency doesn't get too bad */ + cpu_input_boost_kick_max(100); + devfreq_boost_kick_max(DEVFREQ_MSM_CPUBW, 100); + if (should_reclaim_retry(gfp_mask, order, ac, alloc_flags, did_some_progress > 0, &no_progress_loops)) goto retry;