It is similar to mm counter updating, try to batch lruvec stat updating, which could save most of time when all folios in same memcg/padat, lat_pagefault shows 3~4% improvement. Kefeng Wang (4): mm: memory: add prepare_range_pte_entry() mm: filemap: add filemap_set_pte_range() mm: filemap: move __lruvec_stat_mod_folio() out of filemap_set_pte_range() mm: filemap: try to batch lruvec stat updating include/linux/mm.h | 2 ++ include/linux/rmap.h | 2 ++ mm/filemap.c | 75 ++++++++++++++++++++++++++++++++++++-------- mm/memory.c | 33 ++++++++++++------- mm/rmap.c | 16 ++++++++++ 5 files changed, 104 insertions(+), 24 deletions(-) -- 2.27.0