Skip to contentSkip to conversation

DISCUSSION Mathieu Desnoyers 1 participant 1 message Jul 3, 2025

lore
Share & tools
lore
#0 lore raw

From 8b020924c24dd1d0914ab04961b15ac040e59b70 Mon Sep 17 00:00:00 2001
From: Mathieu Desnoyers <[email protected]>
Date: Thu, 3 Jul 2025 11:14:45 -0400
Subject: [RFC PATCH v4 0/2] mm: Fix OOM killer inaccuracy on large many-core systems

Introduce hierarchical per-cpu counters and use them for rss tracking to fix the per-mm RSS tracking which has become too inaccurate for OOM killer purposes on large many-core systems.

The approach proposed here is to replace this by the hierarchical per-cpu counters, which bounds the inaccuracy based on the system topology with O(N*logN).

Testing and feedback are welcome!

Thanks,

Mathieu

Mathieu Desnoyers (2):
lib: Introduce hierarchical per-cpu counters
mm: Fix OOM killer inaccuracy on large many-core systems

 include/linux/mm.h                  |   8 +-
 include/linux/mm_types.h            |   4 +-
 include/linux/percpu_counter_tree.h | 108 ++++++++
 include/trace/events/kmem.h         |   2 +-
 kernel/fork.c                       |  31 ++-
 lib/Makefile                        |   1 +
 lib/percpu_counter_tree.c           | 393 ++++++++++++++++++++++++++++
 7 files changed, 530 insertions(+), 17 deletions(-)
 create mode 100644 include/linux/percpu_counter_tree.h
 create mode 100644 lib/percpu_counter_tree.c
Signature · 1 line
2.39.5