Files
AnyPS5/core/libs
mitul72 2df7e993d3 fix(agc): answer a collect memo hit with the generation of the last finished tracker update
A per-thread collect memo hit read the tracker generation without the
tracker mutex. A walk running on another thread bumps the generation
before it stamps the blocks it finds written, so the hit could return
a value that walk then stamps blocks with; a caller that recorded it as
its verified generation trusts those blocks in every later
UnchangedSince and never refreshes them.

The tracker now publishes the generation each time an update releases
its mutex (TrackerLock), after every stamp of that update is in place,
and a memo hit returns the published value. MarkWritten's release around
beforeUnwatch does not publish, since it stamps again after relocking.
The per-epoch collect map hit returns the published value too. Completed MarkWritten
bumps are still seen at once; a value older than the live one only
makes a check fail and refresh.

agc_collect_memo_generation links GuestMemory against a fake write watch
that holds a walk after its generation bump, takes a memo hit on another
thread meanwhile, and checks the write the walk then stamps is not
trusted against the generation the hit returned.
2026-10-23 15:11:40 +02:00
..
…