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 A7807C5B543 for ; Wed, 4 Jun 2025 15:50:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3622B8D0027; Wed, 4 Jun 2025 11:50:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 339D08D0007; Wed, 4 Jun 2025 11:50:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 276E98D0027; Wed, 4 Jun 2025 11:50:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 06F718D0007 for ; Wed, 4 Jun 2025 11:50:19 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id BF505BF838 for ; Wed, 4 Jun 2025 15:50:18 +0000 (UTC) X-FDA: 83518154916.30.3E4087C Received: from out-178.mta0.migadu.com (out-178.mta0.migadu.com [91.218.175.178]) by imf05.hostedemail.com (Postfix) with ESMTP id BDE5A100002 for ; Wed, 4 Jun 2025 15:50:16 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=cZIXf235; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf05.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.178 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749052217; a=rsa-sha256; cv=none; b=NF7/LzgW6NjwBQrUB8AwLbgl4MhL+dwTS3JSJAvZL0uD3FNUOdaXjq2XzD/hGRMIjsp3Cw Rj62we9jLOZbeJ7THzLWcH+Z2ab5QOCsZJJQAj3hugMwQZwHWna6NJKQsKhjF/RfCQniil 9+so7G7f23A1TSVoGNdv6FojxDPdlvg= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=cZIXf235; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf05.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.178 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=1749052217; 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=qw67bdu2rkctIrJf3BOzy0IaxqK4dptmAhPDawVcYkE=; b=QSJAqMc1CO1ALVuyw7U20yH9UPSlw4NIRBg8q1P8K/0NMJcOXbG4G8lSQXKZEjf9CewDii kDSppEX3KF9JQIZoT+gQgop9cWY94V2GzL6DuJNzCvndXnDQqg4j+Tqsm/5+94KcbW0nQC W0D5X/+Ij95eDA9+GDhBXKtBah44Sg0= Date: Wed, 4 Jun 2025 11:50:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1749052214; 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=qw67bdu2rkctIrJf3BOzy0IaxqK4dptmAhPDawVcYkE=; b=cZIXf235CSzopsh2sFJ9rIVD0JKeut8M4pk8lPKRTapM+DfRIAsuWVqAdPNMZJo0a6JQPv MjwknndvYSxkLjK92lI8Wxus1OFg9fmfT0ukpuZ2hI2BW2opBtWJ7oAETytClo/MTnJOq5 sTNAiBPZxkoBVHDrNYj9w00p3FSTpWs= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Suren Baghdasaryan Cc: Casey Chen , linux-mm@kvack.org, yzhong@purestorage.com Subject: Re: [PATCH 0/1] alloc_tag: add per-numa node stats Message-ID: <5kmfzrxlvstcip33qgqgdi7hhkptzx7dggqghxb4n3z634g7r3@tb2utwfq5qqx> References: <20250530003944.2929392-1-cachen@purestorage.com> <5iiwnofmnx565g3xv3zdt35b7qkuwylzedkidnav72t24asswj@omjgyjnauulg> 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: BDE5A100002 X-Stat-Signature: 66tefjc3brf3eguit946hi4pyqjze75a X-Rspam-User: X-HE-Tag: 1749052216-675977 X-HE-Meta: U2FsdGVkX19j5h+VLhv6JKXpN9XS36eOIi1K7OSdRJOsuApcNRiEi0r9PputwzAG600rl/Nb+xujTT35ShIYTgLas3IIUQbQ4NOhySEGEKBZ4qoSy9FU9JgIC+/qKYWx9GkSe80QU2CWmN6RYxZRNj/n6I0GKFGk1HvcjMtrZeXCpUFDtDG01HA3dhYmtnYOUD1ASFbSWxF1M6vN7oaW5m/oOiJJNtced1z1p3I+yKLaynKCqSSKp1MWPbxdHFCib5VE0HCwPy8IgF5h0Jn2gYXc+mfE7KtW0hIJlgfPqbfaPiUCQPRdXj3XOQPGSvY3Jeu/tz8UEzJodLveujCZg3siWxBZJAbYW5e6GbXoNok5IAwEA46lX/jeLMjxRf82sfyOmvKnEOzUgcz61uhDAq+AggsPffgKAN8lJ4OIdLnQELgA+GVdVvR3jiuOnPyqJOsimFEDun4Vd/Fv+nADCW3eGo0s1O622XeynzAoNTdqCKuuwPD5aoE/EFwnnVTuEsMlQPM0P/uo+UX6ifXZCvF0aBaANnqWVNjqM701c2dVofz7e9qF8CZtdHq+JvNZyRocvHFL8AvemshkzaIxigE5a+/eoux8oMLfmVyWJ0+kHT2dNI7TzkqOraZKesvLOfmyfM6odutDt7lNOw71iCci/LTkM8ScLnBHupnm5JuE4+BaJXm8Q19lrTufs5NMb/Dfn4wwi8H1lWTve9qwGPgU7nnlwgo/GY/oDVwPs0Cm34QhZRLXNwwGbUBBqgiArwwf7ajdtbw1hvtujcpLFycI2Efvt/2vjm8OCSx5+TL458YUz/Jrxg0CVVAFAfpHgqoFPMqvpFATIZJv9t+ZbbIsJrYMrTBs0NF97VBnnUbcxwAYyE9Qqu3Mudt2l7ybAIfop7mSx9fJ+dHey+rVQ0gzjuVjrviULiVCeazbkuNcYskh8XbxjE/4VLrbG74PQGSvnXtnNyPbXKxBowv zWBpLZrm ozG8+tpLcoge7iFsDRcOpStOOUndms+lFGZhQuLjvrv9gE6noxF12yeqKrd1QsuBaOSWKbuDQ8ITXSSDTUbW7xAujcXLqM4lCE7ubM/v7R2o28iKTFQ05ObSOve+zfIWAVKUUk/eMw1GkY8mytgpucd633cZObmK2F5DqMlG4TsK/dOJu4LvTJYKc7+mbtI6ngkUDiskUVNPmFXahvNNy93xn2uxnUG0w5mG5SDwsLTEPI9k8qz/mmpX8yiwRSjoke9Wsc4r1Io3U1ZkfB7CE6IJUScBuzelFkhIriDGUZi5HGuJLc9/ar2FhpZ4/4fmgCw+2WApOB7ffgbG8iOaNdktXOspx6FMn9TXFbxnztp+JqJvnh/0Q8IRcgH7K6PYm+7T/UVPzxzhgCEg= 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 Wed, Jun 04, 2025 at 08:21:48AM -0700, Suren Baghdasaryan wrote: > On Tue, Jun 3, 2025 at 5:55 PM Casey Chen wrote: > > > > On Tue, Jun 3, 2025 at 8:01 AM Suren Baghdasaryan wrote: > > > > > > On Mon, Jun 2, 2025 at 2:32 PM Suren Baghdasaryan wrote: > > > > > > > > On Mon, Jun 2, 2025 at 1:48 PM Casey Chen wrote: > > > > > > > > > > On Fri, May 30, 2025 at 5:05 PM Kent Overstreet > > > > > wrote: > > > > > > > > > > > > On Fri, May 30, 2025 at 02:45:57PM -0700, Casey Chen wrote: > > > > > > > On Thu, May 29, 2025 at 6:11 PM Kent Overstreet > > > > > > > wrote: > > > > > > > > > > > > > > > > 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'? > > > > > > > > > > > > > > > > > > > > > > Mark percpu allocation with 'percpu y/n' because for percpu allocation > > > > > > > stats, 'bytes' is per-cpu, we have to multiply it by the number of > > > > > > > CPUs to get the total bytes. Mark it so we know the exact amount of > > > > > > > memory used. Any /proc/allocinfo parser can understand it and make > > > > > > > correct calculations. > > > > > > > > > > > > Ok, just wanted to be sure it wasn't something else. Let's shorten that > > > > > > though, a single character should suffice (we already have a header that > > > > > > can explain what it is) - if you're growing the width we don't want to > > > > > > overflow. > > > > > > > > > > > > > > > > Does it have a header ? > > > > > > > > Yes. See print_allocinfo_header(). > > > > > > I was thinking if instead of changing /proc/allocinfo format to > > > contain both total and per-node information we can keep it as is > > > (containing only totals) while exposing per-node information inside > > > new /sys/devices/system/node/node/allocinfo files. That seems > > > cleaner to me. > > > > > > > The output of /sys/devices/system/node/node/allocinfo is > > strictly limited to a single PAGE_SIZE and it cannot display stats for > > all tags. > > Ugh, that's a pity. Another option would be to add "nid" column like > this when this config is specified: > > nid bytes calls > 0 8588 2147 kernel/irq/irqdesc.c:425 func:alloc_desc > 1 0 0 kernel/irq/irqdesc.c:425 > func:alloc_desc > ... > > It bloats the file size but looks more structured to me. Debugfs is also an option.