The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 0/2] mm, memcg: fix memory.peak reset clobbering other fds' watermark
@ 2026-08-07  8:59 Ridong
  2026-08-07  8:59 ` [PATCH v2 1/2] memcg: acquire peaks_lock when reading memory.peak Ridong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ridong @ 2026-08-07  8:59 UTC (permalink / raw)
  To: Johannes Weiner, Michal Hocko, Roman Gushchin, Shakeel Butt,
	Andrew Morton
  Cc: Muchun Song, Tejun Heo, Michal Koutný, cgroups, linux-mm,
	linux-kernel, Ridong Chen, cui.tao, Ridong Chen

From: Ridong Chen <chenridong@xiaomi.com>

Two fixes for the per-fd memory.peak / memory.swap.peak handlers added in
c6f53ed8f213. Each open fd reads back max(its own value, the shared
local_watermark), and both bugs live in that scheme.

---

Changes since v1 [1]:
 - New patch 1: hold peaks_lock in the peak readers (Sashiko).
 - Patch 2: floor the peers with max(usage, local_watermark), mirroring
   peak_show(), and skip the writing fd (Johannes Weiner).

[1] https://lore.kernel.org/all/20260730115314.1069089-1-ridong.chen@linux.dev/

Ridong Chen (2):
  memcg: acquire peaks_lock when reading memory.peak
  mm, memcg: fix memory.peak reset clobbering other fds' watermark

 mm/memcontrol.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2026-08-07 20:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07  8:59 [PATCH v2 0/2] mm, memcg: fix memory.peak reset clobbering other fds' watermark Ridong
2026-08-07  8:59 ` [PATCH v2 1/2] memcg: acquire peaks_lock when reading memory.peak Ridong
2026-08-07  9:00 ` [PATCH v2 2/2] mm, memcg: fix memory.peak reset clobbering other fds' watermark Ridong
2026-08-07 20:22 ` [PATCH v2 0/2] " Andrew Morton

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