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 BC8B5C54FB3 for ; Fri, 30 May 2025 01:11:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3EAAA6B0083; Thu, 29 May 2025 21:11:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 39BF16B0085; Thu, 29 May 2025 21:11:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D8646B0088; Thu, 29 May 2025 21:11:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 02E876B0083 for ; Thu, 29 May 2025 21:11:36 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 954875FEDC for ; Fri, 30 May 2025 01:11:36 +0000 (UTC) X-FDA: 83497796592.13.E8A5185 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) by imf19.hostedemail.com (Postfix) with ESMTP id DB9291A0005 for ; Fri, 30 May 2025 01:11:34 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=s8VxAIqD; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf19.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.186 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=1748567495; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SFqBD7ln6zS5H9hy2ZMlX2ll2Op11IzDnmUfLperY5s=; b=aq0wqvCg9RGKlyFf+v/ZZL3i8X4SJptkDbDrTN7Tc5cqMXl5QwmO7IVixupSBLmVouaHpo 6wlfQ+sB/AGs9STNsyXxiDqdVKxnP8Say8vv8IS9ekdL7dULBP2XX1siQOLLCHpKSI6Xl1 xVE9dBOS275mTx6Or61aL7461Vv1pHk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1748567495; a=rsa-sha256; cv=none; b=W/a2CgiKf4Wc9ak9LdvaOThMyVbQ1C2erCT1EZCsWCUg5ENDpvkAYVaIBEy4+rk8C3P+sy me5bX3r1WSxY9A+LF4AfHiUKdY9Hz6A042A4G3Dcf+kmBXnHezkUax5IHFqkh1sZ10cDfj 66COk8iHDPkLRi2NWtQwMXVnE1zL88E= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=s8VxAIqD; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf19.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.186 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev Date: Thu, 29 May 2025 21:11:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1748567492; 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: in-reply-to:in-reply-to:references:references; bh=SFqBD7ln6zS5H9hy2ZMlX2ll2Op11IzDnmUfLperY5s=; b=s8VxAIqDiSP2c2WyGzkKoOiKIR769ulHGSXwHWj90VSP9aD1DwKy8nzxFXNxMKz7lY2E6W KAZpKn6PlZ/hbT1c4+u/Sy2b7md3WfdIru7qsuRn8QfCSQBY3Et/oDiOKt1wR9Ud3/KQqk hs06w5lx084q9LDnRXSen3TLPdrkAWQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Casey Chen Cc: linux-mm@kvack.org, surenb@google.com, yzhong@purestorage.com Subject: Re: [PATCH 0/1] alloc_tag: add per-numa node stats Message-ID: <5iiwnofmnx565g3xv3zdt35b7qkuwylzedkidnav72t24asswj@omjgyjnauulg> References: <20250530003944.2929392-1-cachen@purestorage.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250530003944.2929392-1-cachen@purestorage.com> X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: DB9291A0005 X-Stat-Signature: rhr61m8k5dq51y9s1ezqmeb86g7jp4y3 X-Rspam-User: X-HE-Tag: 1748567494-819837 X-HE-Meta: U2FsdGVkX1+Z2io1Nno3+HssDZYLnK9/GGTVKbNxt/LRdr8TGbVWbUppehOEOtiaNlLisHTMq0HgN6aB0wZb5jFhwc+Wp5fptsvA56m8Bx7G3deVEVRttonMBU+bPyzEjAiyQ+mGY66Ec1E7UuR+f8qB4qA8hSfNi3Mrvw0gkZhMFaJ7ZVtRKquJBc7rTOhTZIyKoWPW18GFmDQIdpMPYtgy226sTsisiHtMv2GpgPvOem7finX2ieGtYClAv31fTHHzxqVLqSkaLwccxW4tmWEcutlinkad0FAKGontKWSdmBIYbar3DU+CGMeD/pW/1TDlSCkPl13/evyE0ed1ImlOhZmRLCDd2K7QimfMcZxqodBhSnc/8/M5lXiHJeBjObESimp1T4EwL2x2Z5p0JoQauQAo/mgQqlC5ocBwD+1uIYeaevlc68eO2TARUArGfKfqui/2Hy85vAGXDNBJ66LXfYw8/hO4clN+Mp3pMDff79aqylPvmLIv4BPOn8PZgllJW/IRUjD81dvSYwfl8BmNauI4++ooki+3OmI06vaIo6NdduDPbrICS/w1Lj1HHkkdmLA4hjAiEUTGq4HoQg2efVUfM4vr8iObtCezfyNd7/UbfB54q7Qutc/GeVEA4PoujBQnVPaS6fKFHjHcTNWLBrjpCjCdSNQGNl6Qgn/y9Kj2J9rnnSfUoSI2j/elB7IEF0CscVmm5UlNC8aK78d7K14sLfppHG5X52kgzdPskLu7SHflmKlPaZ6tuNaspwkxEnts9smeOSOLa/gMeWrZOnmKpoYhlX8rjBoDWLyDVTiXB0YMfs1e3mNWEhHAcsJeHl3XvS9Yp6bN8ZrWcTbVADbeLopJi5ixojbG++zJ/XasmZumzqnUbn6FE9Z0PigwAEKghBztyPnDk/eg+v1wzmZjdn5L 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 Thu, May 29, 2025 at 06:39:43PM -0600, Casey Chen wrote: > The patch is based 4aab42ee1e4e ("mm/zblock: make active_list rcu_list") > from branch mm-new of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm > > The patch adds per-NUMA alloc_tag stats. Bytes/calls in total and per-NUMA > nodes are displayed in a single row for each alloc_tag in /proc/allocinfo. > Also percpu allocation is marked and its stats is stored on NUMA node 0. > For example, the resulting file looks like below. > > percpu y total 8588 2147 numa0 8588 2147 numa1 0 0 kernel/irq/irqdesc.c:425 func:alloc_desc > percpu n total 447232 1747 numa0 269568 1053 numa1 177664 694 lib/maple_tree.c:165 func:mt_alloc_bulk > percpu n total 83200 325 numa0 30976 121 numa1 52224 204 lib/maple_tree.c:160 func:mt_alloc_one > ... > percpu n total 364800 5700 numa0 109440 1710 numa1 255360 3990 drivers/net/ethernet/mellanox/mlx5/core/cmd.c:1410 [mlx5_core] func:mlx5_alloc_cmd_msg > percpu n total 1249280 39040 numa0 374784 11712 numa1 874496 27328 drivers/net/ethernet/mellanox/mlx5/core/cmd.c:1376 [mlx5_core] func:alloc_cmd_box Err, what is 'percpu y/n'? > > To save memory, we dynamically allocate per-NUMA node stats counter once the > system boots up and knows how many NUMA nodes available. percpu allocators > are used for memory allocation hence increase PERCPU_DYNAMIC_RESERVE. > > For in-kernel alloc_tags, pcpu_alloc_noprof() is called so the memory for > these counters are not accounted in profiling stats. > > For loadable modules, __alloc_percpu_gfp() is called and memory is accounted. Intruiging, but I'd make it a kconfig option, AFAIK this would mainly be of interest to people looking at optimizing allocations to make sure they're on the right numa node?