This series introduces the hierarchical tree counter (hpcc) to increase accuracy of approximated RSS counters exposed through proc interfaces.
With a test program hopping across CPUs doing frequent mmap/munmap operations, the upstream implementation approximation reaches a 1GB delta from the precise value after a few minutes, compared to a 80MB delta with the hierarchical counter. The hierarchical counter provides a guaranteed maximum approximation inaccuracy of 192MB on that hardware topology. This series is based on commit 0f2acd3148e0 Merge tag 'm68knommu-for-v7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu The main changes since v16: - Dropped OOM killer 2-pass task selection algorithm. - Introduce Kunit tests. - Only perform atomic increments of intermediate tree nodes when bits which are significant for carry propagation are being changed. Andrew, this is meant to target 7.1 after the 7.0 merge window closes. Thanks, Mathieu Cc: Andrew Morton <[email protected]> Cc: "Paul E. McKenney" <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Dennis Zhou <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Martin Liu <[email protected]> Cc: David Rientjes <[email protected]> Cc: [email protected] Cc: Shakeel Butt <[email protected]> Cc: SeongJae Park <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Sweet Tea Dorminy <[email protected]> Cc: Lorenzo Stoakes <[email protected]> Cc: "Liam R . Howlett" <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Christian Brauner <[email protected]> Cc: Wei Yang <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Miaohe Lin <[email protected]> Cc: Al Viro <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Yu Zhao <[email protected]> Cc: Roman Gushchin <[email protected]> Cc: Mateusz Guzik <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Baolin Wang <[email protected]> Cc: Aboorva Devarajan <[email protected]> Mathieu Desnoyers (3): lib: Introduce hierarchical per-cpu counters lib: Test hierarchical per-cpu counters mm: Improve RSS counter approximation accuracy for proc interfaces .../core-api/percpu-counter-tree.rst | 75 ++ include/linux/mm.h | 19 +- include/linux/mm_types.h | 54 +- include/linux/percpu_counter_tree.h | 367 ++++++++++ include/trace/events/kmem.h | 2 +- init/main.c | 2 + kernel/fork.c | 22 +- lib/Kconfig | 12 + lib/Makefile | 1 + lib/percpu_counter_tree.c | 690 ++++++++++++++++++ lib/tests/Makefile | 2 + lib/tests/percpu_counter_tree_kunit.c | 351 +++++++++ 12 files changed, 1567 insertions(+), 30 deletions(-) create mode 100644 Documentation/core-api/percpu-counter-tree.rst create mode 100644 include/linux/percpu_counter_tree.h create mode 100644 lib/percpu_counter_tree.c create mode 100644 lib/tests/percpu_counter_tree_kunit.c -- 2.39.5
