mbox series

[v1,0/4] Page counters optimizations

Message ID 20240503201835.2969707-1-roman.gushchin@linux.dev (mailing list archive)
Headers show
Series Page counters optimizations | expand

Message

Roman Gushchin May 3, 2024, 8:18 p.m. UTC
From: Roman Gushchin <roman.gushchin@getcruise.com>

This patchset reorganizes page_counter structures which helps to make
memory cgroup and hugetlb cgroup structures smaller (20%-35%) and
more cache-effective. It also eliminates useless tracking of protected
memory usage when it's not needed.

include/linux/hugetlb.h        |   4 +-
 include/linux/hugetlb_cgroup.h |   9 +---
 include/linux/memcontrol.h     |  15 ++----
 include/linux/page_counter.h   |  88 +++++++++++++++++++++++++-------
 mm/hugetlb.c                   |  14 +++--
 mm/hugetlb_cgroup.c            | 150 ++++++++++++++++++++----------------------------------
 mm/memcontrol.c                | 351 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------------------------
 mm/page_counter.c              |  76 ++++++++++++++++++----------
 8 files changed, 340 insertions(+), 367 deletions(-)


Roman Gushchin (4):
  mm: memcg: convert enum res_type to mem_counter_type
  mm: memcg: merge multiple page_counters into a single structure
  mm: memcg: don't call propagate_protected_usage() needlessly
  mm: page_counters: initialize usage using ATOMIC_LONG_INIT() macro

 include/linux/hugetlb.h        |   4 +-
 include/linux/hugetlb_cgroup.h |   9 +-
 include/linux/memcontrol.h     |  15 +-
 include/linux/page_counter.h   |  88 +++++++--
 mm/hugetlb.c                   |  14 +-
 mm/hugetlb_cgroup.c            | 150 +++++---------
 mm/memcontrol.c                | 351 ++++++++++++++-------------------
 mm/page_counter.c              |  76 ++++---
 8 files changed, 340 insertions(+), 367 deletions(-)