Texture queue's lock by place, the pass's shown, nothing and before parts (5-second lines)

The split line of 7d8d56a found, per run of ~150 s, 3.8-5.2 s of the pass
and 33-44 s of other threads waiting for the lock of the queue of textures
picked by index, and 5.0-7.0 s in "slots shown after their upload, flipped
or made at once" (coolfox-20261126-232343, -233017). Two more 5-second lines
say where:
- the queue's lock by place (`descriptor::queue_site`: the pass asking of or
  telling of a slot, taking the slots due, making slots due, noting a slot's
  record, table reads, stale views, else): the times it was taken, the waits,
  how long the places that hold it for many slots held it (the slots due,
  slots made due, stale views), and the times it was not taken (none yet);
- the pass's parts: slots made at once, shown after their upload and
  flipped (time and count); the slots with nothing to bring up to date by
  why (views of textures the host writes, no texture, the host's own
  texture) and how many of them the pass made at once; the work before the
  loops (slots made due, views made again and flips, taking the slots due).

A lock taken is counted by one relaxed add under it; hold times are timed
only at the places that hold it for many slots. Nothing else changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
readmet3xt-labandClaude Opus 5.5 committed 2026-11-27 01:03:43 +05:30
1 parent a83bc910a7
commit 4cee21f397
4 files changed
+245 -61

No files matched your search

+35 -2
View File
@@ -30,11 +30,44 @@ pub(crate) static LOCK_WAITS: [std::sync::atomic::AtomicU64; 4] = [const { std::
/// A wait for lock `which` (0: the texture queue's, 1: the views table's)
/// that began at `started` is over: counted in [`LOCK_WAITS`].
pub(crate) fn waited(which: usize, started: std::time::Instant) {
pub(crate) fn waited(which: usize, started: std::time::Instant) -> u64 {
let other = usize::from(!IN_TEXTURE_PASS.get());
LOCK_WAITS[2 * which + other].fetch_add(started.elapsed().as_nanos() as u64, std::sync::atomic::Ordering::Relaxed);
let ns = started.elapsed().as_nanos() as u64;
LOCK_WAITS[2 * which + other].fetch_add(ns, std::sync::atomic::Ordering::Relaxed);
ns
}
/// The places that take the lock of the queue of textures picked by index
/// (`host::TextureQueue`), counted apart in [`QUEUE_LOCK`].
pub(crate) mod queue_site {
/// The pass asks what is known of a slot, or tells what came of it.
pub(crate) const TELL: usize = 0;
/// The pass takes the slots due and the queue's counts.
pub(crate) const DUE: usize = 1;
/// Slots made due by memory mapped, unmapped or written, by room on
/// the card again, by levels waiting for it.
pub(crate) const MADE_DUE: usize = 2;
/// A slot's record made, copied in or made by a draw or the pass: the
/// slot queued, kept, or taken out.
pub(crate) const WRITE: usize = 3;
/// A draw read the slot through a table: taken out.
pub(crate) const TABLE: usize = 4;
/// Slots made stale by a newer view of other memory: taken out.
pub(crate) const STALE: usize = 5;
/// Anything else (counts for the lines, the bakes' news).
pub(crate) const OTHER: usize = 6;
pub(crate) const COUNT: usize = 7;
}
/// Since the last 5-second line, by [`queue_site`]: the times the texture
/// queue's lock was taken; the nanoseconds threads waited for it; the
/// nanoseconds it was held by the places that hold it for many slots at a
/// time (the slots due, slots made due, stale views); and the times it was
/// not taken because what was asked would have changed nothing
/// (`host::QueueMarks`).
pub(crate) static QUEUE_LOCK: [[std::sync::atomic::AtomicU64; queue_site::COUNT]; 4] =
[const { [const { std::sync::atomic::AtomicU64::new(0) }; queue_site::COUNT] }; 4];
const HEAP_IIDS: [Iid; 4] = [
guid(
0x8efb471d,