Check that a thaw fetches the armed ranges of its regions without the freeze lock, which the review found untested.

memory.c mem_thaw calls lazy_release_regions before it takes frz_lock, so the copy a file read's thaw needs (the
buffer's armed ranges with stale bytes) no longer holds up the other threads' faults, freezes, thaws and arms. All 20
scenarios of tests/lazy_fetch_check.py passed with that call taken out: the thaw scenario reaches the same end state
through thaw_begin_locked's lazy_drop_region_locked under the lock. The new thaw_unlocked scenario has a thread thaw a
page of a range armed with stale bytes while the fetch takes 300 ms, and freezes another region meanwhile: the freeze
returns at once, and took 300 ms with the call taken out. locked_thaw runs it with NX2NAVI_WB_LAZY_UNLOCKED=0, where
the freeze waits for the fetch as in 0.10.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 20:00:02 -05:00
parent 92121a11e8
commit 0eee849948
3 changed files with 22 additions and 2 deletions

View File

@@ -694,8 +694,9 @@ which builds memory.c with the Windows fault handler and a fetch that only waits
process, so an access violation fails it. A thread that reads a range over and over while it is armed and given back
again never reaches the crash handler, also when the arm's clean test takes 100 ms, and a read of a range being armed
does not either when a range in flight in its region ends during that test. A fetch holds up nothing but the
touches of its range: freezes, thaws, arms, releases and copies of other ranges return at once meanwhile, two ranges
fetch at once, and more touching threads than the flight table holds all end. The touches of a range in flight wait
touches of its range: freezes, thaws, arms, releases and copies of other ranges return at once meanwhile, also while
a thaw fetches the armed ranges of its own regions, two ranges fetch at once, and more touching threads than the
flight table holds all end. The touches of a range in flight wait
for it and run again, a write among them without releasing the region's other ranges; thaws, mapping changes,
releases of its buffer, arms and freezes see it. The same with `wb_lazy_chunk = 1`, and with `wb_lazy_unlocked = 0`
the fetch holds the freeze lock again. The "mem: lazy write-back" lines give the longest fetch, the longest wait of a