• Yu Zhao's avatar
    mm: multi-gen LRU: remove aging fairness safeguard · 7348cc91
    Yu Zhao authored
    Recall that the aging produces the youngest generation: first it scans
    for accessed folios and updates their gen counters; then it increments
    lrugen->max_seq.
    
    The current aging fairness safeguard for kswapd uses two passes to
    ensure the fairness to multiple eligible memcgs. On the first pass,
    which is shared with the eviction, it checks whether all eligible
    memcgs are low on cold folios. If so, it requires a second pass, on
    which it ages all those memcgs at the same time.
    
    With memcg LRU, the aging, while ensuring eventual fairness, will run
    when necessary. Therefore the current aging fairness safeguard for
    kswapd will not be needed.
    
    Note that memcg LRU only applies to global reclaim. For memcg reclaim,
    the aging can be unfair to different memcgs, i.e., their
    lrugen->max_seq can be incremented at different paces.
    
    Link: https://lkml.kernel.org/r/20221222041905.2431096-5-yuzhao@google.comSigned-off-by: default avatarYu Zhao <yuzhao@google.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Michael Larabel <Michael@MichaelLarabel.com>
    Cc: Michal Hocko <mhocko@kernel.org>
    Cc: Mike Rapoport <rppt@kernel.org>
    Cc: Roman Gushchin <roman.gushchin@linux.dev>
    Cc: Suren Baghdasaryan <surenb@google.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    7348cc91
vmscan.c 212 KB