From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout.efficios.com (smtpout.efficios.com [158.69.130.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A477A36E48B; Tue, 17 Feb 2026 16:17:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=158.69.130.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771345034; cv=none; b=d025baDUt0thTsA51xgOL4laWWGTeyHO+rhTzbDXdn5RB/yQIubpN6xosJpDLLYEeKQ+xn6ltcohOH2tznr03PLnC+aaxla/bDdLM4N5N5j5HEHg48HrQydAdyROCtzh6/Zi7nQT94vV4gxenEWBzaR0g8VGMPA7O8Yg/CpB6+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771345034; c=relaxed/simple; bh=9xtudly2mJ1u2vHo7FyxKYLIqDgx5hdFyDtsYcMtw7w=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=JkLMmZ6TOsWBzQCXKdLY+d1PRj4WL+hpR58mJb9MMkwI1RXW6KbB/gSjXz8uidD683ymns09yQLsKlx/qYTFFboWksYzGo/JWkU7hmXtsViRnJCDXJCA5N+bYtOY0Vud7q3+3ru2WHGfJTP/S8C2+0r7CTfVXjG7dbXsSwVy/VM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com; spf=pass smtp.mailfrom=efficios.com; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b=uiYw6nyk; arc=none smtp.client-ip=158.69.130.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="uiYw6nyk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=smtpout1; t=1771344616; bh=7oSA143xwhlpR+YOhY78eAKWPWQQBvPwfH3/iKdQHP0=; h=From:To:Cc:Subject:Date:From; b=uiYw6nykBEOTbBd3NOKpiB9QphOhW+vwiQiTPXqz4H8uGpnsbjc+Fq0w8CK2gpp+w GZvzUdguuC4ODm1aNGDOjtOes6HF7kk+Pbus/xn2lJHwHXjCibwYJaXU9w/7/BmXed 5KxiI0Z6Pu/eByLlsFeEaOZZAHGAnKGyI0ZAs4VxDPKzydNJyb9aiOR6pftCCZD8tY qv6l7x0uo70/Eh+AB0p8AOjxIxZyBFDhm8NdZ+mclPMp40JETVmaUF5HI8ZnkbP3of 3ZacZfK1ILpW8adMk6795otJmIk5CmdSSEPF0MOAjAnNydDAE25J+dKkIxwwj5eouP 5NgWTC5HqaQ4w== Received: from thinkos.internal.efficios.com (unknown [IPv6:2606:6d00:100:4000:1cd8:5cbf:5001:d5b1]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4fFl3X13D5zFT9; Tue, 17 Feb 2026 11:10:16 -0500 (EST) From: Mathieu Desnoyers To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , "Paul E. McKenney" , Steven Rostedt , Masami Hiramatsu , Dennis Zhou , Tejun Heo , Christoph Lameter , Martin Liu , David Rientjes , christian.koenig@amd.com, Shakeel Butt , SeongJae Park , Michal Hocko , Johannes Weiner , Sweet Tea Dorminy , Lorenzo Stoakes , "Liam R . Howlett" , Mike Rapoport , Suren Baghdasaryan , Vlastimil Babka , Christian Brauner , Wei Yang , David Hildenbrand , Miaohe Lin , Al Viro , linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, Yu Zhao , Roman Gushchin , Mateusz Guzik , Matthew Wilcox , Baolin Wang , Aboorva Devarajan Subject: [PATCH v17 0/3] Improve proc RSS accuracy Date: Tue, 17 Feb 2026 11:10:03 -0500 Message-Id: <20260217161006.1105611-1-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: "Paul E. McKenney" Cc: Steven Rostedt Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: Dennis Zhou Cc: Tejun Heo Cc: Christoph Lameter Cc: Martin Liu Cc: David Rientjes Cc: christian.koenig@amd.com Cc: Shakeel Butt Cc: SeongJae Park Cc: Michal Hocko Cc: Johannes Weiner Cc: Sweet Tea Dorminy Cc: Lorenzo Stoakes Cc: "Liam R . Howlett" Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Christian Brauner Cc: Wei Yang Cc: David Hildenbrand Cc: Miaohe Lin Cc: Al Viro Cc: linux-mm@kvack.org Cc: linux-trace-kernel@vger.kernel.org Cc: Yu Zhao Cc: Roman Gushchin Cc: Mateusz Guzik Cc: Matthew Wilcox Cc: Baolin Wang Cc: Aboorva Devarajan 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