All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mm: skip current when memcg reclaim
@ 2021-10-19  7:29 Huangzhaoyang
  2021-10-19  8:55 ` Michal Hocko
  0 siblings, 1 reply; 2+ messages in thread
From: Huangzhaoyang @ 2021-10-19  7:29 UTC (permalink / raw)
  To: Andrew Morton, Johannes Weiner, Michal Hocko, Vladimir Davydov,
	Zhaoyang Huang, linux-mm, linux-kernel

From: Zhaoyang Huang <zhaoyang.huang@unisoc.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@unisoc.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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] mm: skip current when memcg reclaim
  2021-10-19  7:29 [PATCH v2] mm: skip current when memcg reclaim Huangzhaoyang
@ 2021-10-19  8:55 ` Michal Hocko
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2021-10-19  8:55 UTC (permalink / raw)
  To: Huangzhaoyang
  Cc: Andrew Morton, Johannes Weiner, Vladimir Davydov, Zhaoyang Huang,
	linux-mm, linux-kernel

On Tue 19-10-21 15:29:36, Huangzhaoyang wrote:
> From: Zhaoyang Huang <zhaoyang.huang@unisoc.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@unisoc.com>
> ---
> patch v2: grant current second chance if previous reclaiming failed

It would be really better to wait until a discussion around the previous
version is concluded before posting another one.
Btw. this changelog has some serious gaps in both the problem and
solution description. Please spend some time looking at other changelogs
for MM patches to get some idea about the level of details that we
usually require.

Thanks!
-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-19  8:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19  7:29 [PATCH v2] mm: skip current when memcg reclaim Huangzhaoyang
2021-10-19  8:55 ` Michal Hocko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.