On Wed, 2026-11-25 at 10:27 -0300, Eduardo P. Gomez wrote: > (sending a copy to the mail list) > > Hi Thomas, > > Under memory pressure, the existing shrinker indeed worked in my > unpatched > 7.4-rc4 QEMU test. It reclaimed all 768 MiB, and the competing > allocation > completed. > > And yes, I'm actually facing out of memory freezes on my 32 GiB > desktop. My > early investigations showed GPUReclaim was using most of my RAM (the > test > repo is the result of my last test before creating the patch). The > tests > shows GPUReclaim stayed at 12.25 GiB of 32 GiB for at least 60 > seconds > after the reproducer exited. In a separate 8 GiB desktop run with v3, > it > dropped to about 128 MiB by the five-second sample. > > Once the allocation burst is over, what benefit do we get from > keeping the > full pool until memory pressure, compared with trimming the excess > after a > short window for reuse? My concern is the cost of reclaiming a pool > that > large when another workload already needs the memory.
The benefit is that since it is costly to transition memory from WC to WB, we do it only on demand. The kernel can't guess whether the next application to be used requires a lot of GPU memory or not. And we don't need to add complexity to go beyond the core reclaim mechanisms. But the allocation latency didn't seem to be the trigger for this work, rather unexpected OOMS. Did you actually see any instance of remaining GPUReclaim memory when OOM was hit? Thanks, Thomas > > If you’d like to try the standalone reproducer at 8 GiB, I’d be > interested > to see how long a competing allocation takes on the unpatched kernel > once > it needs memory back from the pool. > > Thanks, > Eduardo
