On Thu, Jul 02, 2026 at 09:41:14AM +0100, Catalin Marinas wrote: > On Fri, Jun 26, 2026 at 08:52:03AM -0700, Breno Leitao wrote: > > +pass "min_unref_scans=1 immediate; =2 gated to 2nd scan (counts > > $first/$s1/$s2); param read-back ok" > > Are these off by one?
They seem to be OK, and I've tested it multiple times. > Kmemleak has a mechanism to detect live objects > via the checksum. A side effect is that on allocation, the checksum is 0 > and only after the first scan the checksum is changed. I got the impression that checksum continues to be zero for these objects during the whole life time? (weird). If you think this selftest brings value, let me investigate what the heck is happening here. > On checksum mismatch (i.e. the first scan), we mark the object gray > temporarily and won't increment unref_scans. So we already have an > implicit two scans required to report an object as unreferenced during > its early life. > > I think this test needs a priming scan to update the checksums > followed by the actual check for min_unref_scans (with scan=off, > otherwise random scanning will skew the results). I tried a priming scan and it actually breaks the min_unref_scans=2 case

