From mboxrd@z Thu Jan 1 00:00:00 1970 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]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52A86C61CE7 for ; Wed, 11 Jun 2025 03:47:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB7246B0095; Tue, 10 Jun 2025 23:47:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C8F4A6B0096; Tue, 10 Jun 2025 23:47:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BCDDC6B0098; Tue, 10 Jun 2025 23:47:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9E9196B0095 for ; Tue, 10 Jun 2025 23:47:48 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 4CCE681940 for ; Wed, 11 Jun 2025 03:47:48 +0000 (UTC) X-FDA: 83541735816.05.3E253DC Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) by imf02.hostedemail.com (Postfix) with ESMTP id 73CFE8000B for ; Wed, 11 Jun 2025 03:47:46 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=KuVeWYfp; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf02.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.173 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749613666; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xvpnQoqgyLnzKDoMRY0NMalAYqmO3bg2+7Ckkfaxpf0=; b=8eVblSTZ5AeQsqdlbJcBgtt1EB9bHSzOh+epyZHN/EoOM7RCZbO4t57m5PeHxmGGjYdzLS PGsk1PWwKaMBISMOtrIhvyYHiJm73mUYYUn/q53/IQ4mxTwSOs8zm9zIAnfKvHAn3fJsqT ngcerXl0hIe1wcCrwr2lUaYYgVTo8IM= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=KuVeWYfp; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf02.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.173 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749613666; a=rsa-sha256; cv=none; b=Ex2vR2npqsPx8HFLeyeU4arc/L79iSdnZvnCD/pu/uhycDEIgoCDR+C1pom/vO/vuepAEM izCN4ajhqSehga5wAIWZiApc6DeAYwYAB3C9Gt4H+ms9H6jYAY699/46TUt1AFioZSBcx1 qrfq/SQUeAmd2PgUsrm6DHhwGx8a3+Y= Date: Tue, 10 Jun 2025 23:47:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1749613664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xvpnQoqgyLnzKDoMRY0NMalAYqmO3bg2+7Ckkfaxpf0=; b=KuVeWYfp9oMxP80mFfGk0WXdDsLCgRN3km2DUOXVDerGKl7A/kplaxVvPACnnEe9PUDQ5u m6tk6Rq973H5A980GqGmm379Jl7pTGkppi6itYpLImupWjHiS8UawG62U09CPIfGNmxqTe NxXnQE44v+KXCZJpr3x5hV4EfSur+74= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Casey Chen Cc: Andrew Morton , surenb@google.com, corbet@lwn.net, dennis@kernel.org, tj@kernel.org, cl@gentwo.org, vbabka@suse.cz, mhocko@suse.com, jackmanb@google.com, hannes@cmpxchg.org, ziy@nvidia.com, rientjes@google.com, roman.gushchin@linux.dev, harry.yoo@oracle.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, yzhong@purestorage.com Subject: Re: [PATCH] alloc_tag: add per-NUMA node stats Message-ID: References: <20250610233053.973796-1-cachen@purestorage.com> <20250610182155.36090c78124e1f60f2959d8e@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 73CFE8000B X-Stat-Signature: j3e5tzziqbsa7ht98xg6apn4spjnwrxr X-Rspam-User: X-HE-Tag: 1749613666-945125 X-HE-Meta: U2FsdGVkX1/bUTDJ/0QTnBWi3AGJS/os7fs4fIh+tv/oe6wHkzgttFDpN3MH47o9GJUx301zpxYvxuuN5c96y/NWGGsio14LBKUuyraZ9JPM6PbeoNNYRfLXZdsfcQKirVuJ96hDCv0OOfIwwR7p4CWEZwJ65UXF/3Rs05cHNF9JnygUXbX2W3AGGbqyVKQCUUpgejNfjKh+0IqTOlK5cDNmmjXaVHZrzVzxWFzZKrtgGQv2FKh7OzRslbTmlt7htKVJNxQwTNhicuz9oHoHijjZD8inZiTbdp4E3X4UTxckjlnsFSM8YrHsM9bR91lqk3KQZUNiK6ZzX5dsRTQT+zG1io1+Vy/nswujLhv8VFAXXgW0A/2piKjSibp58c4cLRtStNRp8C1rVnJKl+rFCP22ipaC5/NICT2d2wlPTgeM7skR8mCD9Scsb90pkY3ErEz81e9yk83ZTsvd1s9oYM0JKdQCi1x6lfRxXod0hAuSpvrWciITX2MMarXSAUefexOGve2eS9Mwhz0zZWdndgyIxVCmxpBnxcZ/pYlPzUa7PFLY86xHxwW8BJ1jk/aSo+85HXXmNlFTWfCXosstLZLnHULCmZFhJgiC53i15Uh59CyK7IgsDhl6HPmqj47tehMIQJHYw2tfdEbSc6p81Cqz5t5vqqRY3FiL1mqYiu+tBJMT/5dHAV7+0HcNARDPOuNHNqpe9OP4BI5EruGkLwQfP08EfdHVwIfAVg71xdlgB5F3MqcBxlzMovS+CF2bPIQ7+o1omqn/ldEm6G3+Xu2eyH6JcXmCagHNHhiV7IZUVaAMBuq2398U+JS6xlKnSAlxoVTk3ko8ulPP79UmKBktCMWd4slFnPA/pOA1YY333b8MZlbEujrJzZK+/iJ/xH7UL/Fz+Z6tyI+SvkeqUkf96G3/DiM02pNcEjfrPpHOE/g644XfplNiBjJuFMLuDRtosMjNBB6Nu1D62Y0 /NQsilbL mlwHkA8ulflEFvx/g7P5jLN/14QzFgAQGa2adLoyvikaTZ2fmi2vUG5LlGPupbtPqdqdS+/5eM1whAzdbSsdjY8/uHASIsS9gDRvAKF9TvhT6ip1FvhwPHx+skp2y3k8Y3YLdlkESiLR+7yRWSxGuvqi9++fngQEnO/HPwEzaz4xDkXex6V2PtmRcfz/p4n7THNGoWWcK9/bq1PuHOGyFGiSoUAwbF0o1cK/JeWi2mYDWSvCq9EM7UWJO8didTzo/MHmV2xY0/8ihY6YmzbkbQe1pUSG36eUmIVDivo8M6nh7cHXlud2GBQ6r6ezkvYnDP4NukYTe4VA5yKnMYOc+P5LjC43XPpEbpCsIymM5TeS+GudyhqUzl/D4KUdkJ/UIDAXsx6OGyFHc6cESisZ4GtldSpFpr6lxzfoN/pAr00Z1ACjPB/4IQxjNtWqm7hooOSCgvD+tXCM1ZXM= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Jun 10, 2025 at 06:33:58PM -0700, Casey Chen wrote: > On Tue, Jun 10, 2025 at 6:21 PM Andrew Morton wrote: > > > > On Tue, 10 Jun 2025 17:30:53 -0600 Casey Chen wrote: > > > > > Add support for tracking per-NUMA node statistics in /proc/allocinfo. > > > Previously, each alloc_tag had a single set of counters (bytes and > > > calls), aggregated across all CPUs. With this change, each CPU can > > > maintain separate counters for each NUMA node, allowing finer-grained > > > memory allocation profiling. > > > > > > This feature is controlled by the new > > > CONFIG_MEM_ALLOC_PROFILING_PER_NUMA_STATS option: > > > > > > * When enabled (=y), the output includes per-node statistics following > > > the total bytes/calls: > > > > > > > > > ... > > > 315456 9858 mm/dmapool.c:338 func:pool_alloc_page > > > nid0 94912 2966 > > > nid1 220544 6892 > > > 7680 60 mm/dmapool.c:254 func:dma_pool_create > > > nid0 4224 33 > > > nid1 3456 27 > > > > > > * When disabled (=n), the output remains unchanged: > > > > > > ... > > > 315456 9858 mm/dmapool.c:338 func:pool_alloc_page > > > 7680 60 mm/dmapool.c:254 func:dma_pool_create > > > > > > To minimize memory overhead, per-NUMA stats counters are dynamically > > > allocated using the percpu allocator. PERCPU_DYNAMIC_RESERVE has been > > > increased to ensure sufficient space for in-kernel alloc_tag counters. > > > > > > For in-kernel alloc_tag instances, pcpu_alloc_noprof() is used to > > > allocate counters. These allocations are excluded from the profiling > > > statistics themselves. > > > > What is glaringly missing here is "why". > > > > What is the use case? Why does Linux want this? What benefit does > > this bring to our users? This is the most important part of the > > changelog because it tells Andrew why he is even looking at this patch. > > > > > > Probably related to the above omission: why per-nid? It would be more > > flexible to present the per-cpu counts and let userspace aggregate that > > into per-node info if that is desirable. > > > > Hi Andrew, > > Thanks for taking time reviewing my patch. Sorry I didn't include you > in the previous conversion. See > https://lore.kernel.org/all/CAJuCfpHhSUhxer-6MP3503w6520YLfgBTGp7Q9Qm9kgN4TNsfw@mail.gmail.com/T/#u It's good practice to add lore links to any and all previous discussion to the commit message for the latest patch, like so: Link: https://lore.kernel.org/all/CAJuCfpHhSUhxer-6MP3503w6520YLfgBTGp7Q9Qm9kgN4TNsfw@mail.gmail.com/T/#u Make sure to give as much as context as possible - and your commit message should always include _rationale_ - none of us can keep up with everything :)