All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: skip current when memcg reclaim
@ 2021-10-15  6:15 Huangzhaoyang
  2021-10-15 20:00 ` Andrew Morton
  2021-10-18  8:23 ` Michal Hocko
  0 siblings, 2 replies; 17+ messages in thread
From: Huangzhaoyang @ 2021-10-15  6:15 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>

Sibling thread of the same process could refault the reclaimed pages
in the same time, which would be typical in None global reclaim and
introduce thrashing.
---
 mm/vmscan.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 5199b96..ebbdc37 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2841,6 +2841,11 @@ 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)
+				continue;
 			memcg_memory_event(memcg, MEMCG_LOW);
 		}
 
-- 
1.9.1


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

end of thread, other threads:[~2021-10-20 15:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15  6:15 [PATCH] mm: skip current when memcg reclaim Huangzhaoyang
2021-10-15 20:00 ` Andrew Morton
2021-10-16  2:28   ` Zhaoyang Huang
2021-10-16  2:58     ` Andrew Morton
2021-10-16  3:05   ` Matthew Wilcox
2021-10-16  8:17     ` Zhaoyang Huang
2021-10-18  8:23 ` Michal Hocko
2021-10-18  9:25   ` Zhaoyang Huang
2021-10-18 12:41     ` Michal Hocko
2021-10-19  7:11       ` Zhaoyang Huang
2021-10-19  9:09         ` Michal Hocko
2021-10-19 12:17           ` Zhaoyang Huang
2021-10-19 13:23             ` Michal Hocko
2021-10-20  7:33               ` Zhaoyang Huang
2021-10-20  8:55                 ` Michal Hocko
2021-10-20 11:45                   ` Zhaoyang Huang
2021-10-20 15:11                     ` 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.