intel/rt: Fix L3 bank performance bottlenecks due to SW stack stride alignment.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 19 Oct 2022 23:13:24 +0000 (16:13 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Sun, 26 Feb 2023 19:48:33 +0000 (11:48 -0800)
commit4420251947443e5f29ecc702900e560e66e73f0e
tree46bde67154f241b0ae10f689ffddbb465ac5ef5c
parentde4e3da4c42ba4c2ce4c45b1db59f25f2858b014
intel/rt: Fix L3 bank performance bottlenecks due to SW stack stride alignment.

Power-of-two SW stack sizes are prone to causing collisions in the
hashing function used by the L3 to map memory addresses to banks,
which can cause stack accesses from most DSSes to bottleneck on a
single L3 bank.  Fix it by padding the SW stack stride by a single
cacheline if it was a power of two.  This has been reported by Felix
DeGrood to improve Quake2 RTX performance by ~30% on DG2-512 in
combination with other RT patches Lionel Landwerlin has been working
on.

Many thanks to Felix DeGrood for doing much of the legwork and
providing several iterations of Q2RTX performance counter dumps which
eventually prompted me to consider the hash collision theory and
motivated this patch, and for providing additional performance counter
dumps confirming that there is no longer an appreciable imbalance in
traffic across L3 banks after this change.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21461>
src/intel/compiler/brw_rt.h