Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] mm/memcontrol: fix stuck FLUSHING_CACHED_CHARGE bit on isolated cpus
@ 2026-08-28 13:46 Rik van Riel
  2026-08-28 13:46 ` [PATCH] mm/memcontrol: extract stock drain predicates into helpers Rik van Riel
  2026-08-28 13:46 ` [PATCH] mm/memcontrol: avoid stuck FLUSHING_CACHED_CHARGE bit on isolated cpus Rik van Riel
  0 siblings, 2 replies; 7+ messages in thread
From: Rik van Riel @ 2026-08-28 13:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Rik van Riel, Johannes Weiner, Michal Hocko, Roman Gushchin,
	Shakeel Butt, Muchun Song, Andrew Morton, cgroups, linux-mm,
	kernel-team

drain_all_stock() can leave FLUSHING_CACHED_CHARGE set after the
work is dropped.  It sets the bit before checking isolation and
schedule_drain_work() checks isolation and queues in a separate RCU
critical section, so housekeeping_update()'s synchronize_rcu() can
race the second check.

drain_local_stock() only clears the bit for work that ran, so the bit
remains set and the stock is never drained again.

Patch 1 extracts the stock drain predicates into helpers.

Patch 2 reorganizes the drain_all_stock() loop, reducing nesting,
splitting out local vs remote cpu handling, and skipping everything
on isolated cpus, which solves the stuck FLUSHING_CACHED_CHARGE flag.

Link: https://sashiko.dev/#/patchset/20260827124211.3b94b103@fangorn

Rik van Riel (2):
  mm/memcontrol: extract stock drain predicates into helpers
  mm/memcontrol: fix stuck FLUSHING_CACHED_CHARGE bit on isolated cpus

 mm/memcontrol.c | 61 ++++++++++++++++++++++++++++---------------------
 1 file changed, 35 insertions(+), 26 deletions(-)

--
2.55.0


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

end of thread, other threads:[~2026-08-28 16:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28 13:46 [PATCH 0/2] mm/memcontrol: fix stuck FLUSHING_CACHED_CHARGE bit on isolated cpus Rik van Riel
2026-08-28 13:46 ` [PATCH] mm/memcontrol: extract stock drain predicates into helpers Rik van Riel
2026-08-28 13:46 ` [PATCH] mm/memcontrol: avoid stuck FLUSHING_CACHED_CHARGE bit on isolated cpus Rik van Riel
2026-08-28 14:25   ` Michal Hocko
2026-08-28 14:56     ` Rik van Riel
2026-08-28 15:41     ` Shakeel Butt
2026-08-28 16:13       ` Rik van Riel

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