The create_64MiB regression (matrix 61f2799088: next_take 7-27x old on RADV, NVIDIA and the
Iris). Each create in the harness's loop takes a 64 MiB Shared block, which takes an
allocation of its own, and gives it back; the next create takes again straight away. A take
looked only at the kept blocks, and the block-maker thread keeps a given-back block only when it
gets to the queue. While the thread was inside a driver call (a 16 MiB vkAllocateMemory or a
vkFreeMemory, 3-70 ms on the NVIDIA cards), the take found nothing, allocated a fresh 64 MiB
on the guest thread (fresh pages, their first touch in the memset), and the block it missed
left its allocation idle and over the window's peak, to be freed: a free that kept the thread
busy for the next take. Shown by the new test at the parent of this change
(every_device_takes_a_long_block_given_back_again_at_once, draft at 30cc1a0b69): on the RTX
3090 (m3-max-45044) rounds 3-19 each allocated one and freed one; on the RX 550 (45043) round
16 did; lavapipe (45042) none.
- Pool::take, after the kept blocks, takes a block from the give-back queue that the thread
would keep (not spilled) and of the length asked: its allocation stays in use throughout, so
no bookkeeping changes but the reuse count and the window's note.
- The block-maker thread holds the lock from popping a kept block off the queue to pushing it
on the kept blocks (it dropped it in between, with nothing to do for a kept block), so a take
finds the block in one or the other.
- The test: 20 takes of a 64 MiB Shared block, each given a zeroed buffer and given back, each
take straight after the give-back before: only the first allocates, 19 reuse, none is freed.