mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-16 11:49:59 -04:00
completion_main calls vk_mem_collect after it publishes each new done, and vk_mem_collect waited for cmd_lock. An upload flush holds that lock across vk_queue_lock, behind a present call (FIFO, a frame limiter inside the present, frame generation) or another long queue-lock hold. With wait = 1 it also holds it across its batches' fence waits, and stg_create waits for batch fences under it. The single completion thread blocked there could not process the next timeline value, so the next done, and every fence waiter for it, waited for that chain. vk_mem_collect_try only tries cmd_lock. When the lock is busy it still destroys the finalized pools, which need only retire_lock, and leaves the deferred objects to a later completion or to the next upload flush's own collect. After eight busy tries in a row it waits as vk_mem_collect does, which keeps the deferred list bounded, as before. pool_fini keeps the waiting vk_mem_collect. The trace=perf "mem: sizes" GPU line counts the collects that gave way. Not reproduced before the change: the completion thread's lock waits are not timed. Checks that passed: pass_cc_check on every runtime file (vk.h changed), no new -Wall -Wextra warnings in vk_memory.c and vk_sync.c, sync_hw_check, gpa_check, mem_budget_check, tex_release_check, mem_growth_check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
354 KiB
354 KiB