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 36E94C83F1A for ; Fri, 11 Jul 2025 03:09:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BF82A6B0099; Thu, 10 Jul 2025 23:09:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BCF936B009A; Thu, 10 Jul 2025 23:09:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B0C846B009B; Thu, 10 Jul 2025 23:09:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id A1A186B0099 for ; Thu, 10 Jul 2025 23:09:40 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 4B82B110BD3 for ; Fri, 11 Jul 2025 03:09:40 +0000 (UTC) X-FDA: 83650503720.27.5D0C5CB Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) by imf29.hostedemail.com (Postfix) with ESMTP id 55CE412000B for ; Fri, 11 Jul 2025 03:09:38 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Ha2jJ+1U; spf=pass (imf29.hostedemail.com: domain of kent.overstreet@linux.dev designates 95.215.58.173 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1752203378; 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=HzOTbQ1Df5qkQWA6hvvWlK1j4HvbNfCUSsN8QNrENNI=; b=TX9PGijjmyAYJ5ODv0RMnpC2fJ4wtvTlNBcJZXi2wBaTRhHUWx39GRmu5kzb38XGmx4UAP 0aH8AKY5xm3DFLcNmdhFig3/+mlLxECOV7yf9FTiYDcjBw2D+kRCjxS6F2Obe3+fP3sSE4 3mUz43NowltzR7KN/lxKD4ebh46FtK8= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Ha2jJ+1U; spf=pass (imf29.hostedemail.com: domain of kent.overstreet@linux.dev designates 95.215.58.173 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1752203378; a=rsa-sha256; cv=none; b=w7qHv+5rBzIQas2t4JBdPS6VWqnqmK63v1V/PrLp8rSfMtVtwfkDadDkeoOSYB+P4WOw8h fr+EghgLm05BmGl/4ZBkGlXjJfb8VBYedLr8C+6J8FEnF2ZoSFw5yKBtleFrSE96PzN4m+ BflLebE5qfJFMXKpE1R9QtoluZPkVPw= Date: Thu, 10 Jul 2025 23:09:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1752203376; 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=HzOTbQ1Df5qkQWA6hvvWlK1j4HvbNfCUSsN8QNrENNI=; b=Ha2jJ+1Un81FwO48RYKC+YAoTVvgzxsJE5vDg3xIUoIXu8kiYU146iH1BKTlDg7kdqSChg chPi2Twa/a8WDyrhdZngLl7qtueqOyA/Zl0rMqyAvZm/oRlldCopdGRi4j1DpN6B5AmasM 1+LiVG0rG5qG6TbOiF5qCzJBDgFqkig= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Casey Chen Cc: akpm@linux-foundation.org, 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, souravpanda@google.com, 00107082@163.com Subject: Re: [PATCH v3] alloc_tag: add per-NUMA node stats Message-ID: References: <20250711002322.1303421-1-cachen@purestorage.com> 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-Rspam-User: X-Rspamd-Queue-Id: 55CE412000B X-Rspamd-Server: rspam09 X-Stat-Signature: 3hggu6p5i3e5q574i6j4im3z5riscon4 X-HE-Tag: 1752203378-839160 X-HE-Meta: U2FsdGVkX1/ckKNXx5qR4SUvH6fDG+cdt5kxotmSsL7b3m7SL2h5yHyhIJiYkgoUz+hcrPPPZoExoC1IzwS5Wx9lM3pyUFUrHzwYqqWRPoOvWmldEq54NjDfC5ihC+nGBhmhy/yFIyj6wfc2cCfX9eBUL8GZ8TjbcWtj1eKxUBMQJAARsMfAxagiaKIfaLx2fdmAHQwxUfMpq4o8cvm5vnH8lCiVEIs2sWFsydeXhu6EOrwvvZzitDfnI+UkASZ2cbIA+PLT4qvizkrnK7fqLxe2LoUhv4A90kahppq3NPlZdcWtmCRGIvBpjXMabUKOA+cKjIEmTW4lxWM/PDdicfEb8FNNCVh9MN2/H11sLKvzfplIcxCYTLUIG9r7O+q3rAFCNTpWd3a7wyQm8aLKVuBa3+vzH9LTNAggElvwv8syyYiFjeJ30/+G/u54+YDTNt8qdoNT03tMJAmdUUsvSJuBYk9ByHjcCxyBYfecL8GbbBKGL4+vENe+CIdahQ2ec6FQiolCL8kcRL90XbfTDdK7Y55v1Gi1ITg/siIcE52BTWNK2A8tCl1ztHX6EtcR3DM/xLIhJs5FNxocKKaDU1LwxpZd/7H/jquBVJRNttwhIAOcBMiFo6pZ7hH+n5viHf8GdaowHxhMbMUnxbVlZBz5gBmFz/s8rBYBNX1deay7oEhi5i+CP1QxsOamJCltGwuEK+QvzQt3ZhUXap4VRI+fV+lN97FZkTaWJ52q6vkiWFEgupWmr4tMr3iZCiK7h53UJ4FRMTL38u+KF3vinloD+9XBgH8aBE5fmedU1uLHtAHubx6t4h+OXRxxyd1Q/4lecrhE2os5Btu7LxdM2zjmW/Jl7lz/5q30WwMfeX8IHgS+pfUBWsKwqsFaPYksGXw125ytTMCaWci7SHi0x+argsvGkhhurqQVKQkdP9ptw3rZyXj1gA3x8YhlIRrV3sjSU0ObWqEdJDxadSE W2xlvkm8 r7Jl0BP4jdQ0KytBzpstvlBnP1N9b1yW4sPUNqOf9RN7BZUI0y9fpmiSKSrW/8JV1A6ZYQRLBVpqLh9FGM0K+iaC1EV6Nfa9t+2QcI0caOOfMm8g/1iV6RvjCQbaB80ws2/83KesJ72obVGkRp7RLWLxNbxAJlGWewKhMCGzDajc+iakxC5W7K8Et/CE4gWBN6QuUNXgaStoz9AehMw9AJ7pvt0+daq6deDYTwLav9XHdgU7EJ1DacA4ker1FsTY9OGx8ARle5xPJBuvOBCDNSAZFBl1gQbYi1kJUCQ5QdqRkRJrnVPBQx91zl0wCYdi9jS1pkNlorUN+AqhO9woQ/frrLQ== 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, Jul 10, 2025 at 06:07:13PM -0700, Casey Chen wrote: > On Thu, Jul 10, 2025 at 5:54 PM Kent Overstreet > wrote: > > > > On Thu, Jul 10, 2025 at 05:42:05PM -0700, Casey Chen wrote: > > > Hi All, > > > > > > Thanks for reviewing my previous patches. I am replying some comments > > > in our previous discussion > > > https://lore.kernel.org/all/CAJuCfpHhSUhxer-6MP3503w6520YLfgBTGp7Q9Qm9kgN4TNsfw@mail.gmail.com/T/#u > > > > > > Most people care about the motivations and usages of this feature. > > > Internally, we used to have systems having asymmetric memory to NUMA > > > nodes. Node 0 uses a lot of memory but node 1 is pretty empty. > > > Requests to allocate memory on node 0 always fail. With this patch, we > > > can find the imbalance and optimize the memory usage. Also, David > > > Rientjes and Sourav Panda provide their scenarios in which this patch > > > would be very useful. It is easy to turn on an off so I think it is > > > nice to have, enabling more scenarios in the future. > > > > > > Andrew / Kent, > > > * I agree with Kent on using for_each_possible_cpu rather than > > > for_each_online_cpu, considering CPU online/offline. > > > * When failing to allocate counters for in-kernel alloc_tag, panic() > > > is better than WARN(), eventually the kernel would panic at invalid > > > memory access. > > > * percpu stats would bloat data structures quite a bit. > > > > > > David Wang, > > > I don't really understand what is 'granularity of calling sites'. If > > > NUMA imbalance is found, the calling site could request memory > > > allocation from different nodes. Other factors can affect NUMA > > > balance, those information can be implemented in a different patch. > > > > Let's get this functionality in. > > > > We've already got userspace parsing and consuming /proc/allocinfo, so we > > just need to do it without changing that format. > > You mean keep the format without per-NUMA info the same as before ? > My patch v3 changed the header and the alignment of bytes and calls. I > can restore them back. I mean an ioctl interface - so we can have a userspace program with different switches for getting different types of output. Otherwise the existing programs people have already written for consuming /proc/allocinfo are going to break.