Memory: a pool near its next block gets it made ahead, its first growth among them
Blocks were made ahead (memory/ready.rs) only for a pool that grew lately: a second or later pooled block added within KEPT_EMPTY_FOR. So a pool's first growth, and its first after a pause, was always made in place by the creation call whose keep_room found no room for half a block: in a guest's scroll on a Radeon 780M, the buffers' pool's first growth block, made on the guest's thread. A pool made ahead for now also gets its next block made ahead, grown or not, once it is near it (Pool::near_next): it holds a pooled block and its longest free range is below three quarters of a block (ahead_room), a quarter of a block before the half block keep_room keeps. The pools of exportable buffers take the same rule (exported_growing lists those near their next block too). A block made ahead for a pool that stopped growing goes after KEPT_EMPTY_FOR only once the pool has room for three quarters of a block again, so a pool that rests near its next block keeps that block, one at most a pool, counted against the kept empty blocks' budget, and makes none over and over. That is the resting cost, written in docs/FAST-PATHS.md's row on kept blocks and in ready.rs. The other option, a block ready for every pool in use, holds one at rest for every pool, not only those near their next. Tests: blocks_ahead's growing-pool test now asserts its first growth is made ahead too (renamed). reclaim_submit_bench gains a scroll arm: Private buffers of 7471104 bytes (a scroll's, eight to a block) every 30 ms, 64 a phase. Verified on um790's Radeon 780M (RADV PHOENIX) and lavapipe (jobs 12337, 12354): - blocks_ahead, 780M: first growth 1 made ahead, 0 in place (lavapipe the same). Negative, development's memory.rs and ready.rs: 0 ahead, 1 in place, the test fails. - Runtime suite: 780M 2011/2011, lavapipe 2014/2014; clippy with m2v_gpu, m2v_cpu_icd and no cfg clean; rustdoc clean. - reclaim_submit_bench_scroll, release, three runs each, alternating: development made 7 blocks ahead and 1 in place in each phase, quiet and fragmented (compact_stall about 2500 in the pressed phase), every run; with this change 8 ahead and 0 in place in every phase. The slowest creation call: development 0.2 to 0.4 ms, this change 0.1 to 0.2 ms. The in-place makings were fast in this bench's fragmenting; the consumer's trace had the same making under the kernel's compaction. (cherry picked from commit 35c4231506652a454e43e703b162384a0a2f71cc)
This commit is contained in:
1 parent
1c55359c9e
commit
05dcfce04e
5 files changed
+111
-43
No files matched your search
+8
-5
@@ -987,11 +987,14 @@ driver's. Each is open work.
|
||||
waited 1 ms (longest 0.39 to 0.67 ms), 16 empty blocks (1 GiB) kept between the clips. A first
|
||||
clip still makes its blocks: 16 allocations, against 44 when each picture had an allocation of
|
||||
its own, with 3 to 5 commits waiting 1 ms or more (longest 10.9 to 19.6 ms): its blocks'
|
||||
`vkAllocateMemory` holds every submission. A pool that grew gets its next block made ahead
|
||||
(`memory/ready.rs`; the pools of exportable buffers, which hold the pictures, among them), right
|
||||
after a burst of the device's submissions ended, and a creation call that needs it while its
|
||||
making still waits for that end makes it at once and waits for it, as for a block made in place.
|
||||
Metal's command buffers wait for no allocation. Not announced.
|
||||
`vkAllocateMemory` holds every submission. A pool that grew, and one near its next block (it
|
||||
holds a pooled block and lacks room for three quarters of one, its first growth among them), gets
|
||||
its next block made ahead (`memory/ready.rs`; the pools of exportable buffers, which hold the
|
||||
pictures, among them), right after a burst of the device's submissions ended, and a creation
|
||||
call that needs it while its making still waits for that end makes it at once and waits for it,
|
||||
as for a block made in place. A pool near its next block keeps that block at rest for as long as
|
||||
it stays so: one block a pool at most (64 MiB, or a plain pool's smaller block), counted against
|
||||
the kept empty blocks' budget. Metal's command buffers wait for no allocation. Not announced.
|
||||
- **With unified memory, `Private` memory lies in the system heap's types before the device-local
|
||||
ones, its buffers' blocks there allocated exportable but for buffers that declare their padding
|
||||
unobserved: about 1 µs a submission for each such block held.** Where the device has unified memory and a heap that is not
|
||||
|
||||
Reference in new issue
Block a user