From: wang lian(ByteDance) Hi Kairui, On Thu, 19 Nov 2026 05:03:32 +0800 Kairui Song wrote: > I also retested the LevelDB benchmark from the cache_ext paper [4]. > Interestingly, mainline MGLRU already beats CLRU on this one after a > recent change in lru_gen_folio_seq that bumps new folios with refs == 1 > to the second-oldest generation as discussed. That change accidentally > gave random reads a higher hotness level while making sequential reads > much colder as described before [13]. However it's unreliable and > incorrect because it depends on LRU drain timing, and hurts some workloads > as reported, or where the sequential part is actually hotter (any workload > involving hotter large file and many small cold files will be affected) > which is reproduced below. > > This series improves it while covering ordinary workloads too and fixing > more regressions: > > LevelDB Scan / Get, Throughput Total: > CLRU: 4708.3 ops/s > MGLRU: 5026.9 ops/s (faster than CLRU, but hurts other workloads) > MGLRU After: 5179.2 ops/s (even better in all cases, and no regression) > We did observe a LevelDB regression in our earlier tests on our machine. The fixes and results discussed in your cover look promising, and may address our case too. I haven't retested v5 locally yet, so I'll rerun the workload on the current base to check whether the regression is resolved. I'll also look more closely at the access patterns and how MGLRU behaves with them. The results on file-backed workloads have been especially encouraging. Next, I'd like to discuss some anonymous-memory workloads and potential fixes with you. > Others > ====== > > Additionally, PSI, smaps, and readahead should all benefit from better > accuracy since this series unifies the flag usage between classical > LRU and MGLRU. > > Other tests such as MySQL are looking fine, with no regressions. There is > also community test report [7]. > > Refault distance is not included yet, so MGLRU may respond more slowly to > workingset shifts. That can be added later, as previously demonstrated > [8], [9]. > > Extra note about future development: this series is actually highly > compatible with ideas like workingset reporting [10]. The "gen climbing > folio" design may appear to conflict with workingset reporting's idea, > but it doesn't. The solution is simple and straightforward: once we can > extend the generation number to a larger value (e.g. 64 or 128), the > refs-driven promotion can stop at a lower gen (e.g. oldest_gen + 16), > leaving the remaining newer generations as perfectly time-gap-separated > bins. These older gens can be considered as expiring gen. > > The tier count is not fixed either, we'll need to find a way to tune it > if tiers go beyond 4 though, but that shouldn't be hard, not a blocker > either. > > More details are in the individual commit messages. LLM is used to help > improve the comments and tests, all results are double checked. > Thank you for this outstanding work! We've seen some really exciting gains in our tests, and we're very happy with the results. From our earlier private conversations, I know how much time and effort you've invested in this. You deserve all the praise for that dedication. I'll continue reviewing and testing the series and work with you on further improvements. I'll go through the patches one by one, and I'll share the workload scenarios and requirements from our side as we go. Thanks, Lian