Give 64 threads count shards of their own
What: shards::SHARDS goes from 16 to 64, the most the owners' bitmask holds, as the encoders' tallies have. Threads past the owned shards share one by an atomic add: the recorder's command counts and the counts made with no encoder's core at hand. Why: a process where more than 16 threads have counted (a consumer's walk threads beside its other encoding threads) put every later thread on the shared shard, each of their commands an atomic add the others contend for. Memory: 48 more shards of 512 bytes (24 KiB) a device for the core-less command counts, and 24 KiB more for each of the recorder's 8 slots (static). Verified: neutral in the lanes once the tallies took the per-draw counts: game_draws_threads beside 16 idle threads that drew, 5080 (pinned, 5 rounds) 589 -> 582 ns a draw, M3 703 -> 695, both within the rounds' spread; four threads alone 5080 538 -> 562, M3 684 -> 604, the same. tests::recorder_shards (at 64: 67 threads where some share) pass on the M3 (nextest), lavapipe and the 5080 (one process, one test at a time). (cherry picked from commit e7e0c189e7de72c9faba60df76a7e65400c5695c) (cherry picked from commit dec97514e41c7a430d2866be0e0ace5f45b1a853)
This commit is contained in:
1 parent
630deb9385
commit
f1e7a97d56
1 file changed
+1
-1
@@ -36,7 +36,7 @@ use std::cell::Cell;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
|
||||
/// How many shards threads own; the threads past them share one more ([`SHARED`]).
|
||||
pub(crate) const SHARDS: usize = 16;
|
||||
pub(crate) const SHARDS: usize = 64;
|
||||
|
||||
/// The index of the shard no thread owns, which the threads past the owned ones add into.
|
||||
pub(crate) const SHARED: usize = SHARDS;
|
||||
|
||||
Reference in new issue
Block a user