• Mina Almasry's avatar
    mm: disable top-tier fallback to reclaim on proactive reclaim · 6b426d07
    Mina Almasry authored
    Reclaiming directly from top tier nodes breaks the aging pipeline of
    memory tiers.  If we have a RAM -> CXL -> storage hierarchy, we should
    demote from RAM to CXL and from CXL to storage.  If we reclaim a page from
    RAM, it means we 'demote' it directly from RAM to storage, bypassing
    potentially a huge amount of pages colder than it in CXL.
    
    However disabling reclaim from top tier nodes entirely would cause ooms in
    edge scenarios where lower tier memory is unreclaimable for whatever
    reason, e.g.  memory being mlocked() or too hot to reclaim.  In these
    cases we would rather the job run with a performance regression rather
    than it oom altogether.
    
    However, we can disable reclaim from top tier nodes for proactive reclaim.
    That reclaim is not real memory pressure, and we don't have any cause to
    be breaking the aging pipeline.
    
    [akpm@linux-foundation.org: restore comment layout, per Ying Huang]
    Link: https://lkml.kernel.org/r/20221201233317.1394958-1-almasrymina@google.comSigned-off-by: default avatarMina Almasry <almasrymina@google.com>
    Reviewed-by: default avatar"Huang, Ying" <ying.huang@intel.com>
    Reviewed-by: default avatarYang Shi <shy828301@gmail.com>
    Cc: Greg Thelen <gthelen@google.com>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Tim Chen <tim.c.chen@linux.intel.com>
    Cc: Wei Xu <weixugc@google.com>
    Cc: Yosry Ahmed <yosryahmed@google.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    6b426d07
vmscan.c 214 KB