linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] mm: memcg: fix protection of reclaim target memcg
@ 2022-11-23  9:21 Yosry Ahmed
  2022-11-23  9:21 ` [PATCH v2 1/3] mm: memcg: fix stale " Yosry Ahmed
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Yosry Ahmed @ 2022-11-23  9:21 UTC (permalink / raw)
  To: Shakeel Butt, Roman Gushchin, Johannes Weiner, Michal Hocko,
	Yu Zhao, Muchun Song
  Cc: Matthew Wilcox (Oracle),
	Vasily Averin, Vlastimil Babka, Chris Down, linux-kernel,
	linux-mm, Yosry Ahmed

This series fixes a bug in calculating the protection of the reclaim
target memcg where we end up using stale effective protection values from
the last reclaim operation, instead of completely ignoring the
protection of the reclaim target as intended. More detailed explanation
and examples in patch 1, which includes the fix.
Patches 2 & 3 introduce a selftest case that catches the bug.

v1 -> v2:
- Instead of adding a new helper, extended
  mem_cgroup_supports_protection() to check if the current memcg is the
  target memcg, renamed to mem_cgroup_unprotected() which is much easier
  to reason about (suggested by Roman).
- Add a selftest case to catch the bug (suggested by Roman).

Yosry Ahmed (3):
  mm: memcg: fix stale protection of reclaim target memcg
  selftests: cgroup: refactor proactive reclaim code to reclaim_until()
  selftests: cgroup: make sure reclaim target memcg is unprotected

 include/linux/memcontrol.h                    | 31 ++++--
 mm/vmscan.c                                   | 11 ++-
 .../selftests/cgroup/test_memcontrol.c        | 96 ++++++++++++-------
 3 files changed, 87 insertions(+), 51 deletions(-)

-- 
2.38.1.584.g0f3c55d4c2-goog



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

end of thread, other threads:[~2022-12-02  3:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23  9:21 [PATCH v2 0/3] mm: memcg: fix protection of reclaim target memcg Yosry Ahmed
2022-11-23  9:21 ` [PATCH v2 1/3] mm: memcg: fix stale " Yosry Ahmed
2022-11-24  0:40   ` Roman Gushchin
2022-11-24  0:57     ` Yosry Ahmed
2022-11-23  9:21 ` [PATCH v2 2/3] selftests: cgroup: refactor proactive reclaim code to reclaim_until() Yosry Ahmed
2022-11-24  1:03   ` Roman Gushchin
2022-11-24  3:16     ` Yosry Ahmed
2022-11-29 19:42       ` Yosry Ahmed
2022-11-30 17:19         ` Roman Gushchin
2022-11-30 18:25           ` Yosry Ahmed
2022-12-02  3:19             ` Yosry Ahmed
2022-11-23  9:21 ` [PATCH v2 3/3] selftests: cgroup: make sure reclaim target memcg is unprotected Yosry Ahmed
2022-11-24  1:04   ` Roman Gushchin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox