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 2DA52C83F17 for ; Fri, 11 Jul 2025 00:54:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 971FD6B009D; Thu, 10 Jul 2025 20:53:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9260C6B009E; Thu, 10 Jul 2025 20:53:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8385B6B00A0; Thu, 10 Jul 2025 20:53:59 -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 7428E6B009D for ; Thu, 10 Jul 2025 20:53:59 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 12441140E93 for ; Fri, 11 Jul 2025 00:53:59 +0000 (UTC) X-FDA: 83650161798.18.B0A7FC3 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) by imf29.hostedemail.com (Postfix) with ESMTP id 12932120003 for ; Fri, 11 Jul 2025 00:53:56 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=r4KzGQV7; spf=pass (imf29.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.186 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=1752195237; a=rsa-sha256; cv=none; b=DSsWeKCqg8Qzn0dgl1a1BGPzQGabB0WKoOeNyhDvMMWlvMhuJOx1yfAD3QvlbhDCeYV/Y9 b8i2IMei6VE+5iqi/sGLV3kopqCpKZTA6GkAI6T/v3xAG8SuwSwiNrA3bqW2LjLHb6+2dq HcocjU0evlAUIQf9mmO6h0pJjNrhXwg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1752195237; 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=BD12tr+LLYiYR7OTG7xOog1ys1NXTYaW1lkc9WXDyO8=; b=pZsgmYGxmz2IFJzSS6I1/zKyNjFnqaKwtxwGcmyjrqMJuMihP3MiGdSxSRWSRMhQrnPSaB 88vR5rzBfSQStQv6bQzytu3OoXJ9nv9jn9F1wZHspyH+pbiN7DYe7qMRewBoNl5MomXWHA fHiobNNmICz/XSZv9H6PfPhkM0rY+y8= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=r4KzGQV7; spf=pass (imf29.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.186 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Date: Thu, 10 Jul 2025 20:53:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1752195234; 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=BD12tr+LLYiYR7OTG7xOog1ys1NXTYaW1lkc9WXDyO8=; b=r4KzGQV7lsDCehWWSbFWG67lAJvedJha90ev1sbxLF5YzczhqOlVq3O+rjtX5M2zFdjr1E P+7WH5eZwXbnM91kTXmck1abLU7/U+PQm7xAVza9SFDeVPs7HQmoXP/GAbajx9GA81iM49 QKbaDYPFVf60yIPa52U51/np+6LN2HM= 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=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 12932120003 X-Stat-Signature: h6at75gddx3mjpfa5it3ts1swnwoqs9j X-HE-Tag: 1752195236-555973 X-HE-Meta: U2FsdGVkX1+77QHNe/UGIQVbNtQhB01UWF+lEM1aiy9TTrjg3MUzafFcNWr46Bmud+d45LpTMo6gHSrSIPJRBn/HfE3fvhuOcltcynVEldCcSRGxcXIod7mDhBYSct1Nbm9hSkQDN6yH1qiOux8HTaBMTim0LdBdR6ffqJwxQGCxUa124mwvaC8MElPSDLL505RumhqulmKNbnjJBC57QiwSxIHdDzW/raPYPnhnUlxglQrnrXKfcLV5xdhXqp6OCnfrsCEYc8zXKYrU5m5y1+DZlu1fMWYlpgaawmbZJ4x5k6di5i3a2SbIG8sHxqM5nX1lZtEKNQCR8iAeiLlX6IyNJ15WJOIeF5VjDNCwP0oqwVrboxkeaDoLC4AvhV2+sbR28UvcwCoVkLH+Q7H0KNU/w0M8MRRzLkGJRs2hBarvcYX5+s+LvIm5bE9+jehelz3MDmsJxTwyjrt6WfjWG/eF2YWPP8hH/8f9DBoPJmQ39cVYazE63X8VPNKB3POaeABpT7Aa/lRzFRLm/hvoBqiXx+guaw9H6PmhA4z2/jOZsjFigOBlHn1vuTKv6k+5TwchgME7T2ZxULxTU53swWtU0Kdl0gzk0B6Mq3g/xVUm76IEP7kdrnq/6X4lC2/4likjtd6SjYb1VHUSQ+xcZxkV1VNl8Js8EDXDC7HhGhXer2geAYR0mh5jlOZP3SJ6B0N4cXGm4fFZS5XjFqaNthrk0xtsjnaKiG1pd/oIQf/g4kADSCzyqjJy05zzdvOv4P9qZ1tcaoxAk5EQS2vRXWQsD5rgDwdx9TIFpydbkktPLkwD83OZdzG/CEARmFXHLds67aZotAdguAO9wj5lJgs72c4kDX+dR+3uj+pspT/LG+WIupxOQuNstfyWktqvo5J4B+L51PgznW9fR6Js96x23zDymuI/5mzbM7uelJjFkH85oQp/xYs1qGUiV2xagHi+LNM3sl/mR0wvjv+ k/3Qk8pi +54lD2bqf+Fewo1zSY1yyyS/9qjlEP0kq/yLu7gt3jG+a9SyUQFs5ecNS4MG44pWqWcKrc8ASk52uTpxQ2+QLm14VCbUotDxnVhjC48+xXthqG5O3NSW5cGMrLNrOhHOSSl5Vj6fyThmGS2xenmqAjrYVwQ/3qtOS6kjH7qkASoQAdeVqN9n15mIDQAilcqdv+WHlDrrrv4nOCSH7sP4KexXxA8vXUTVBABI4Y21LUv0A6ohmhUyCc+K7blAMKN1DxTqUzwc69N8FFXHn61iIu8lHi+NFls6hr8CLlqXcq5zDk/FKjP+vGwkasA== 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 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.