[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1634628576-27448-1-git-send-email-huangzhaoyang@gmail.com>
Date: Tue, 19 Oct 2021 15:29:36 +0800
From: Huangzhaoyang <huangzhaoyang@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Vladimir Davydov <vdavydov.dev@...il.com>,
Zhaoyang Huang <zhaoyang.huang@...soc.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2] mm: skip current when memcg reclaim
From: Zhaoyang Huang <zhaoyang.huang@...soc.com>
Reclaiming pages from current LRU will introduce page thrashing during direct
reclaiming. Have all memory contraint groups steal pages from the processes
under root(Non-memory sensitive) or other groups with lower thresholds(high
memory tolerance) or the one totally sleeping(not busy for the time being,
borrow some pages).With regard to all groups trapping into direct reclaim,
retry if first round failed and all groups still compete fairly.
Signed-off-by: Zhaoyang Huang <zhaoyang.huang@...soc.com>
---
patch v2: grant current second chance if previous reclaiming failed
---
---
mm/vmscan.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 5199b96..c17ef60 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2841,6 +2841,13 @@ static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc)
sc->memcg_low_skipped = 1;
continue;
}
+ /*
+ * Don't bother current when its memcg is below low
+ */
+ if (get_mem_cgroup_from_mm(current->mm) == memcg) {
+ sc->memcg_low_skipped = 1;
+ continue;
+ }
memcg_memory_event(memcg, MEMCG_LOW);
}
--
1.9.1
Powered by blists - more mailing lists