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 876FA33BBB9 for ; Fri, 4 Sep 2026 16:07:46 +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=1788538070; cv=none; b=gePuaAW0g9BK5r9lYyQJDZsIarxjA8ESnYyFfR5oWCSm4sfhBazHDB9chmsFzK6xGOhKyO+gY8yC7GqWKz9Bt3M6FrR4Js3tYsFihVNEDPWrGcI50yJmtryzRRRHCwRx2UcS/pNKzqeoQ07b+1nBon8ElXV61iVype77gXc0jk0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788538070; c=relaxed/simple; bh=eGus+f2/UGXkaobm7zQlXxY0houb/tlPRMmcuXplSJA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hfmE8WqaYODOjzVcYblvAblvKbNrVM1gI4gpxyaltVv1OlOu1+4yFgP8W41SSPij0RRmc6iwjldzTqc3r8l7Mg17cmFbT5JsRuo48I3KWZkAkdL+k/oKGu2qdW5RtAZRaETiHxunctfZDy57m4XKvobp6UP9hlEhsBBENNnpI7U= 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=rpdrEs39; 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="rpdrEs39" 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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