Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B57F4C79F82 for ; Fri, 4 Sep 2026 16:07:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 80AA06B0098; Fri, 4 Sep 2026 12:07:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 76B276B009D; Fri, 4 Sep 2026 12:07:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 68C4C6B009E; Fri, 4 Sep 2026 12:07:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 3A5D36B0098 for ; Fri, 4 Sep 2026 12:07:40 -0400 (EDT) Received: from smtpin08.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay02.hostedemail.com (Postfix) with ESMTP id BB60212010F for ; Fri, 4 Sep 2026 16:07:39 +0000 (UTC) X-FDA: 85176560238.08.0DE625F Received: from smtpout.efficios.com (smtpout.efficios.com [158.69.130.18]) by imf23.hostedemail.com (Postfix) with ESMTP id 170C3140007 for ; Fri, 4 Sep 2026 16:07:37 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=rpdrEs39; spf=pass (imf23.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 158.69.130.18 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1788538058; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=19kdMNiQwxNu9bc7s+IHFuS9MHPIUiSFua29/KmdJZg=; b=IqgGS1UwrujTwrkNSe3PXLUl6rTgdGm5d7skI3bRHMd47TN+E2e1dLCi27ui1sozKQWGGB R7e4WrmQEZi8xmUzcNokkxm1rRWPQ2OkVpJ87v1ypJk7B7Q7C/HmwPvc/k8u/rzuBDO2aI VO9lakINQEELfi2cJgSGNQUolMt/f+g= ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1788538058; b=2+C6KmZYhZbQ8FY6UYBUpMUhkTzoDMqwyN+7c2H8wMM76vfWj53U8F0KdZwKCF+WcXDrBt OzOOq6EePXDtY+eQiH39mqQVVVEgpnbea6NyHW/OfNmHi1YALK6C2VQMsnOvavkunL4fai YkztJp5IT6xq3WK/6Ws3RwqywkA3KbM= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=rpdrEs39; spf=pass (imf23.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 158.69.130.18 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=smtpout1; t=1788538057; bh=19kdMNiQwxNu9bc7s+IHFuS9MHPIUiSFua29/KmdJZg=; h=From:To:Cc:Subject:Date:From; b=rpdrEs39APtxZ6+3S5p+33a/iyA8sRLllVXkbtA+JmzTwH6mV1kw08UFj3xYwgvmd bwXQEkGIVdjWnmjJZ+JC0pJkg2SX+pQmQF8J4VAYNG7f+kvdQIFqemYWAOwtTDWxaR EyAPcGzv9EosvkaaKlfEOyDu9Uds6cc5Y4qc24ULbc0iq8Rym+26lo0up5voR2ls7u aYYxMEZEu7a2kT/s9/r4Ua+tB4yQTXCCWkyo4P3JUy3+WWe+x612vbQPx2CYCsKzZY mg/fZtIN6Ex3AhbGFb1Xb8uq8EKKr3mMnmPmfu1u6TfNNujBNg+RJX9jag9vGAwJA3 5YNF0gPYLBayg== Received: from compudjdev.. (mtl.efficios.com [216.120.195.104]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4hc1Zd19WhzWWW; Fri, 04 Sep 2026 12:07:37 -0400 (EDT) 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 , Yu Zhao , Roman Gushchin , Mateusz Guzik , Matthew Wilcox , Baolin Wang , Aboorva Devarajan , David Carlier , Josh Law , linux-mm@kvack.org Subject: [PATCH v22 00/10] Hierarchical Percpu Counters for RSS Date: Fri, 4 Sep 2026 12:07:12 -0400 Message-ID: <20260904160734.23445-1-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 170C3140007 X-Stat-Signature: 8pz8xm4t3fmygpmsfprp9k739qfh3u4w X-HE-Tag: 1788538057-100171 X-HE-Meta: U2FsdGVkX1/dcAZafzT/pih9VaCuMh7B0vbRD2Jgoph4O8ulwlJXenwMpCFsmqtc/V5n9utWTul1frsb7ZKccizFKJ93bE7Ab6QQ6HYNE1PaclK2Rvxo7GoS7l9GLzpDtGwSV/O8VrrVhnt53IEYANw4WiFsEIyr+9sspIhHWifb087EVRSZw7uler+pVGK4vwuHcQld59qboIg0a8bz7qnSAvJtYB0LxgFxMpF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JEMXME3EWmOtTmPGlL77Idkg6hhd4g2U1+YqolNBIK0lT0IYR9FVTzORTum5bbMflGOMcx1TNf3SadjrifOuXhRuOwqZZXg/awlx2RryWAuzGORFKGq+PeQLG/uzB2bf9iDMRSW3/0MKUfJG+mJ/OT+XJ9LsV0IBriwAn7qZIomN3ezokOXEWgBIKLDTXQRyAXiw5N4PhGXxJeCkMtlaEc+dLbkAe/prAXhkB9KjuDD2c1Tpltqu516rvXNpcbJkbYK1S0CIJmNk7JhA+JXi25W4Hm9DJbCfuz0xa5hIuTI12F79JrurILGvMNOjdZrz64zKLKp6xHAxHe6s7Rdh+P9N2zvfdLl65cYoE5hgGnw1Dydzs+owXn/n/fHICemQCaFgIliTrYehiiKxepMbYBS+tK/gY99CB3CaK0GYK9i3hU5nR+kP8K5ZMXqtL3q6okG7drT7uBY4MauCXH/Q2DVQH+j0Keu65clIFG/JSE/zLp4pzur3lCbENjJBQJmrCSN1Aq+odbT1vt+9CUYvacM3vUP7hWvh5v+1WjXqzaqw7depnkkQGBY1hDKzEXjSLvBtyrlgS4g7enLp7GW/d2N+vVdWdUpDbUio2u/Vu/85uyc66zsPoqXm4llit6m5PCO2Ql rTQ4cSri WlK+mVCagh7I24vGV4gQy++eLioK4hU/yyvmEcH8a+H1bgzZd7JnSOoMtGhZNEYWlWiWAWr4IoXF5WJgyf8oZuJ2WbBEmVaOAnnoKP5IS/dBzQILbBsX7Y6gTcdlHrS35owsPLogzyRF48r9cCSPo76JhcaYhYPN Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Andrew, Here is the hierarchical percpu counters for RSS accounting series rebased on top of v7.3-rc1. It includes a series of documentation and test code fixes done to answer a review from Sashiko at: https://sashiko.dev/#/patchset/20260901182857.26690-1-mathieu.desnoyers@efficios.com This aims at replacing the prior version of the series you had in mm. As a reminder, the goal here is to provide more precise RSS counters through /proc. A future step would be to also use these counters to speed up the OOM killer task selection when OOM is triggered by memcg. In whole-machine OOM situations, latency introduced by the OOM killer task selection may not be too much of an issue, but for memcg, where cgroups may routinely depend on the OOM killer, the acceptable latency tradeoff is quite different. Thanks, Mathieu Mathieu Desnoyers (10): lib: introduce hierarchical per-cpu counters lib: test hierarchical per-cpu counters mm: improve RSS counter approximation accuracy for proc interfaces mm: reorder mm_struct flexible array to place mm_cpumask first init: move percpu_counter_tree_subsystem_init() earlier in boot lib: inline percpu_counter_tree_items_size with boot-safety sentinel lib/hpcc: Document that accuracy is a property of settled counters lib/hpcc: Clarify accuracy range documentation lib/hpcc: Introduce wrapped delta helper lib/tests/hpcc: Fix hotplug, module unload, and error handling Cc: "Paul E. McKenney" Cc: Steven Rostedt Cc: Masami Hiramatsu 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: Yu Zhao Cc: Roman Gushchin Cc: Mateusz Guzik Cc: Matthew Wilcox Cc: Baolin Wang Cc: Aboorva Devarajan Cc: David Carlier Cc: Josh Law Cc: Andrew Morton Cc: linux-mm@kvack.org .../core-api/percpu-counter-tree.rst | 82 ++ include/linux/mm.h | 20 +- include/linux/mm_types.h | 65 +- include/linux/percpu_counter_tree.h | 391 +++++++++ include/trace/events/kmem.h | 2 +- init/main.c | 2 + kernel/fork.c | 24 +- lib/Kconfig | 12 + lib/Makefile | 1 + lib/percpu_counter_tree.c | 747 ++++++++++++++++++ lib/tests/Makefile | 2 + lib/tests/percpu_counter_tree_kunit.c | 583 ++++++++++++++ 12 files changed, 1899 insertions(+), 32 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.43.0