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 C2361C83F1B for ; Fri, 11 Jul 2025 17:41:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 562FB6B009C; Fri, 11 Jul 2025 13:41:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 53AE06B009F; Fri, 11 Jul 2025 13:41:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 477F26B00A1; Fri, 11 Jul 2025 13:41:52 -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 3A8EC6B009C for ; Fri, 11 Jul 2025 13:41:52 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 93A97133F4D for ; Fri, 11 Jul 2025 17:41:51 +0000 (UTC) X-FDA: 83652701622.29.4258394 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf04.hostedemail.com (Postfix) with ESMTP id 5D36040017 for ; Fri, 11 Jul 2025 17:41:49 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=purestorage.com header.s=google2022 header.b=P95LSnZD; dmarc=pass (policy=reject) header.from=purestorage.com; spf=pass (imf04.hostedemail.com: domain of cachen@purestorage.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=cachen@purestorage.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1752255709; 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=tT7wPE70oe7dzBsi7RXbG4kZfWut7Hwc/EXvaRJKRy8=; b=SyH5nDsDjZztKYihGQReaEi2hmxNHd1cEUO0XpwO/cUrbnLqP39LhQN5jgReUc8QPDWF+0 50P2EcEvyjTGDNWjVDJ4lKngmJbNTmuDe0wOjntUaxU14p/mbAf1IsstvSr4fes/hG/2xK tXE1wVLyqOX/P/4dNlB2OHrfQvDukKU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1752255709; a=rsa-sha256; cv=none; b=RWaCGLIXZeaJMO7qzEiK2twHlw6QuB4wHQWzBX42Ppk8uH+B/gw4U94MZV2WEWKXDKWpI+ Nokh3N3Xufje11pQHtlIPuRleyQtGdjvVjrnt6gMHGL2n5jJrEAXrz4yynXSs0h4ern6db 3jD6jaQBdx3mOoqrj24kcIE2PlqmNHM= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=purestorage.com header.s=google2022 header.b=P95LSnZD; dmarc=pass (policy=reject) header.from=purestorage.com; spf=pass (imf04.hostedemail.com: domain of cachen@purestorage.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=cachen@purestorage.com Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-313bcf6e565so330733a91.0 for ; Fri, 11 Jul 2025 10:41:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1752255708; x=1752860508; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tT7wPE70oe7dzBsi7RXbG4kZfWut7Hwc/EXvaRJKRy8=; b=P95LSnZD4z2tRC8ZkUhEdklo8polOR1p+/KTZVUYgKc1bmR1C4jswb1U2MaAK6P3Oc SvzCEZAYhewLthQ1mOtuBFDN7pXRZmeJIflU6Bv4zFn6L/ulLrGuhAD+sE9KqC4m5cOp pFj/S+4K8oOMXVezktEXWY1r3yBVAe/9Ay21rsFTfRI9zTrGOufQPskBVmohh8FpfCVJ DttBw5kYcPUybBZiM1Kz3pyL2nKHevhCi0JKvn2w9cJnMcGH/ji7a1WsJysTCFmscn0n fkW+BrHFxiPM4z6u42sc1zOizUnB1k3yRj+/o46AMutYWPOq6VIC/BDWKSXF8/dj0gE7 KOsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752255708; x=1752860508; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tT7wPE70oe7dzBsi7RXbG4kZfWut7Hwc/EXvaRJKRy8=; b=rGHWKxujd49qCnhycFbC4WOL/fpGmdZmxUvmP1LfBGK/4NXScbbEetClXnLnJBVFhL sp+gHdn5dCyLp3fKr/ryajqJzOZx4s5HTUHMhuSIX3Vs0KOZqER5s0hcxNXxGjVZflNJ Bj8QmgYSX/GQoF66OQaHv56FEOftTW7148lq/E2ru/wphGA7UJnkHNq7HsGk/ae+FeEj 6GBCJVrf/o3+esZkUu+rhmoaXiGVVBwGh5u8PJdS0nUPnnA7Lj5k6SvuYnKLRxnKMmpy EiQsOEHMbaZ7zt9656xTEcKcmrnrAkoxTujA38Twil7Pnutkz03fYbs3TzlAMs5v3+rb 9a8g== X-Forwarded-Encrypted: i=1; AJvYcCVosAqRXlMGDJjfNJWmSYvWy1AkvFn2WOOq3+BM0H452i7NRPAztj/GmTRm3Bne6LIp+SxlPMehOQ==@kvack.org X-Gm-Message-State: AOJu0YwO38MEJBxdbBVZGieaY1zW5F78XSCpWw3BYFZR8+S3cGaM+STG 09oNqErv1zaBnzTZ+g3Ik3sjHWVpSbUwRuIyflbFm1TgqcN3aKRdV9yAEJvTgsXc9xDk/IYBOgo OQu5tZsZRp2mW59G6+xu/hoKTi9gj0cacz/XiUJKPgA== X-Gm-Gg: ASbGncsOVGXADDoG5forTA4Rm2dBJwtybbfDuGfHmtFxTqdXmKprMxALZYvgUlJ62vU TnGtxnTVrETdVqr6f4bcGC3BR8I1Lf0/PwLw7dhAY6KUN7j0jfGwNqpb7Vf/4MjHfAhHEVSNJL3 MTXKEHT5NWDj6WDpr6CtlnoyvVkXzPN+/gtrh0MbOKP2GL9Bb6eGfhDAU/tPWkkpqG7hbwBECvx O9wJtk= X-Google-Smtp-Source: AGHT+IFMl4SOsBNCWSNMVioKK3ph3e85yFGBL3ByOiB15jaiAYdBhfZ9gIl691PiBIkdZctaSd5iyta4TNPAm0XoiR4= X-Received: by 2002:a17:90b:3cc8:b0:30a:80bc:ad4 with SMTP id 98e67ed59e1d1-31c4f37b71cmr1911945a91.0.1752255707877; Fri, 11 Jul 2025 10:41:47 -0700 (PDT) MIME-Version: 1.0 References: <20250711002322.1303421-1-cachen@purestorage.com> In-Reply-To: From: Casey Chen Date: Fri, 11 Jul 2025 10:41:36 -0700 X-Gm-Features: Ac12FXxsYtMviMJqxEQ9G8qJWSE_VTggBxwThpyFF_kw7PGNiKJUHiqTVkGYiMM Message-ID: Subject: Re: [PATCH v3] alloc_tag: add per-NUMA node stats To: Kent Overstreet 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 5D36040017 X-Stat-Signature: dfis5akxwwbinu5rcw4x1fnhyskhdbkk X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1752255709-772036 X-HE-Meta: U2FsdGVkX1/bxyrBNQiK2tA3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Y3mV0r1MQ6E5zOoyypXZVDLNnEwdofge/oMX4pFAAS7w82k5fYCBufzFFPlYm7Am/BOMLdKCi2PTemZc+kLwrdOYzTtsN49YuJ7sy2FEEgDq/yoHJRWfIfX+N95+zAI4emcQ/AHcjyTKmYPpzCMvC11iPPf0DpPmy8sjIYh/i+KNah4Xl9aRNgBC69zrYVTTA== 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 8:09=E2=80=AFPM Kent Overstreet wrote: > > On Thu, Jul 10, 2025 at 06:07:13PM -0700, Casey Chen wrote: > > On Thu, Jul 10, 2025 at 5:54=E2=80=AFPM 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 commen= ts > > > > in our previous discussion > > > > https://lore.kernel.org/all/CAJuCfpHhSUhxer-6MP3503w6520YLfgBTGp7Q9= Qm9kgN4TNsfw@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 NUM= A > > > > 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 pat= ch > > > > 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'. I= f > > > > 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. What does this IOCTL interface do ? get bytes/calls per allocating site ? or get total bytes/calls per module ? or per-NUMA bytes/calls for each allocating site or module ? Would it be too much work for this patch ? If you can show me an example, it would be useful. I can try implementing it.