startup: snapshot pool totals and per-reason memory SRV overflow #3480
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3480"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T17:09:22Z.
Refs #3477 (items 2 and 4; items 1 and 3 come in a separate PR).
Counting and logging only. Allocation and refusal decisions are unchanged, and both refusal logs are still limited to 8 lines.
Snapshot pool totals (item 2)
reserve_upload_ringcounted reservations, bytes and refusals for the upload ring only. The guest memory input snapshot pool now has its ownSnapshotPoolTotals(upload_reservation.h), updated underallocator_lock.The periodic
x2w-render upload ring:line gains a suffix:used: allocated prefixes of all chunks; a chunk's bytes are subtracted when it is recycled.high-water: peak ofused.reserved,reservations: cumulative.refusals: cumulative, one counter per cause. Every refusal is counted, including those past the 8 logged lines and the zero or oversized requests, which stay silent in the log as before.The ring counters move from the
note_reservedlambda intofinish(), which runs on the same success paths. Thesnapshot pool reservation refusedline keeps its text and its limit of 8.Memory SRV census: calls past the shape table, per reason (item 4)
Once the 128-entry shape table is full, refusals of new shapes only added to one total. They are now also counted per reason, and the report ends with one more line when that total is non-zero:
The per-reason counts sum to the existing
calls past the shape tabletotal. The table size and its key are unchanged. The report line buffer grows from 1024 to 1534 bytes.Tests
Base
c4b8a41b, presetdev:4/4 passed.
startup_snapshot_pool_totals(new,upload_reservation_check --snapshot-pool-totals): tail reservations, a recycled chunk, the 8-line limit shared across causes, and the exact summary text.startup_memory_srv_census(extended): the overflow line, its per-reason counts, and periodic reports when only overflow counts changed.Mutations, each rebuilt and run:
startup_snapshot_pool_totalsusedstartup_snapshot_pool_totalsstartup_snapshot_pool_totalsstartup_memory_srv_censusstartup_memory_srv_censusstartup_memory_srv_censusMerges cleanly with #3469 and #3466 (
git merge-tree).Not covered
reserve_upload_ringat runtime and the periodic line itself are not exercised by a test; the tests coverSnapshotPoolTotalsand the census class.usedcounts chunk prefixes until the chunk is recycled, including chunks whose fences have completed.no unused capacityfor every cause; the cause is only in the counters.Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T08:34:14Z.
Review: APPROVED
Reviewed
d4ac8de4by reading the diff; not built or run.Verdict: approve. Counting only, and the totals stay consistent with the chunk state. No MUST.
usedis right becausereuse_upload_chunkis the only place a chunk'susedis reset (upload_reservation.h:188). The release-at-submit path (note_submits,release_upload_chunks_at_submit) changes holds and generations, notused. The recycled reservation is counted once:note_reserved(rounded, recycled), thenreserve_upload_chunkis called without totals.finish()runs on exactly the four success paths that used to callnote_reserved. The ring refusal log keeps its own limit of 8, so splitting the old sharedrefused[2]changes nothing.more_shape_reasons_hasmemory_srv_reason_countentries, one fewer thanreasons_. That is safe, because the overflow branch is reached only throughmemory_srv_reason_has_shape, which requiresreason < memory_srv_reason_count.log()formats into 1536 bytes with 2 kept for CRLF, so the census buffer of 1534 is exactly its maximum. The upload-ring line with the new suffix stays well under it.refusalalready holds the cause at the log call (d3d12_xs_device.cpp:2871), so the line could name it instead of always sayingno unused capacity. That would close the third "Not covered" item.Tests:
startup_snapshot_pool_totalscovers tail, second chunk, in-flight and recycle, the shared 8-line limit and the exact summary text. The census check covers overflow per reason and overflow-only periodic reports, and the six mutations show both catch their target. CI did not run them: neitherupload_reservation_checknor the census tests are in theprpreset's list, and/O2was skipped on the PR.