perf(vk): memory_collect_written takes the captured ranges once a submit, not a lock and a pool-list refresh per dirty page #854

Merged
SadTransGirl merged 1 commit from perf/collect-written-one-lock into main 2026-11-09 08:47:09 +00:00
SadTransGirl commented 2026-11-08 23:15:21 +00:00 (Migrated from github.com)

For every page the host's collection returned, capture_owns took cap_ranges_mu, called refresh_pool_ranges_locked and searched the three range lists: thousands of lock cycles a submit, the cost that retired gpu_pages' per-page lock (the comment above memory_stamp_gpu). The union of the three lists is now built once, under the lock, and only when cap_ranges_ver changed (as capture_make keeps its own), and each page is tested against it with one binary search.

Tested: RTX 4070 SUPER, Windows 11, several sessions of Kokiri Forest and Hyrule Field over one evening: identical picture, no device loss; the per-submit "writes collected" time in the log stays at 0.03-0.06 ms with 400-470 dirty pages a submit.

For every page the host's collection returned, capture_owns took cap_ranges_mu, called refresh_pool_ranges_locked and searched the three range lists: thousands of lock cycles a submit, the cost that retired gpu_pages' per-page lock (the comment above memory_stamp_gpu). The union of the three lists is now built once, under the lock, and only when cap_ranges_ver changed (as capture_make keeps its own), and each page is tested against it with one binary search. Tested: RTX 4070 SUPER, Windows 11, several sessions of Kokiri Forest and Hyrule Field over one evening: identical picture, no device loss; the per-submit "writes collected" time in the log stays at 0.03-0.06 ms with 400-470 dirty pages a submit.
Commenting is not possible because the repository is archived.
No description provided.