Repository navigation
[release-1.0] Cherry-pick #3476: leave page cache out of the memory guard's overshoot check - #3513
Merged
Dmitry Berkovich (dberkov) merged 1 commit intoOct 31, 2026
Conversation
…strate#3476) Follow-up to agent-substrate#3429, from @aramase's review: agent-substrate#3429 (comment) When the pod can lend a microVM snapshot write all the memory it needs, the actor's cgroup has no `memory.high` during the write, so it can end with a lot of dirty page cache. Putting `memory.high` back reclaims what it can, but gives up on pages still dirty or under writeback: https://github.com/torvalds/linux/blob/v7.0/mm/memcontrol.c#L4409-L4429 The memory guard resumes as soon as the write returns, before teardown, and its overshoot check counted that page cache. So it could kill the paused VM and report the actor crashed for exceeding its memory limit. The overshoot check now leaves reclaimable page cache out too, and both checks take what's left from one `memory.stat` read. The kernel only flushes `memory.stat` past a threshold of updates, so it can trail `memory.current`, and subtracting one from the other could count fresh page cache as used: https://github.com/torvalds/linux/blob/v7.0/mm/memcontrol.c#L561-L564 AI use: AI-assisted, I reviewed and tested it. - [x] Tests pass - [x] Docs updated --------- Signed-off-by: Benjamin Elder <[email protected]> (cherry picked from commit 6ddb193) Signed-off-by: Benjamin Elder <[email protected]>
Dmitry Berkovich (dberkov)
merged commit Oct 31, 2026
9754aea
into
agent-substrate:release-1.0
7 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #3476 onto
release-1.0(git cherry-pick -xof the squash commit), it applied cleanly with no changes.The memory guard's overshoot check leaves reclaimable page cache out, so it no longer kills a paused microVM and reports the actor crashed when a snapshot write leaves dirty page cache behind. This fixes a bug in #3429, which is in 1.0.
AI use: AI-assisted. Clean pick.