On Tue, Nov 11, 2025 at 02:13:42PM +0800, Leon Huang Fu wrote: > Fewer CPUs? Your surprise makes me realize I confused this with something else [1] where harnessing the job to a subset of CPUs (e.g. with cpuset) would reduce the accumulated error. But memory.stat's threshold is static (and stricter affinity would actually render the threshold relatively worse). > We are going to run kernels on 224/256 cores machines, and the flush threshold > is 16384 on a 256-core machine. That means we will have stale statistics often, > and we will need a way to improve the stats accuracy. (The theory behind the threshold is that you'd also need to amortize proportionally more updates.) > The bpf code and the error message are attached at last section. (Thanks, wondering about it...) > > > > > All in all, I'd like to have more backing data on insufficiency of (all > > the) rstat optimizations before opening explicit flushes like this > > (especially when it's meant to be exposed by BPF already). > > > > It's proving non-trivial to capture a persuasive delta. The global worker > already flushes rstat every two seconds (2UL*HZ), so the window where > userspace can observe stale numbers is short. This is the important bit -- even though you can see it only rarely do you refer to the LTPs failures or do you have some consumer of the stats that fails terribly with the imprecise numbers? Thanks, Michal [1] Per-cpu stocks that affect memory.current.