From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59E6D2C11FA for ; Fri, 13 Feb 2026 21:44:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771019044; cv=none; b=n8zEowbtGBK3It+xFf6nm3j1t1c8/Azt1mPmWP3XlUS32WtUkOjws9Xgw67BpT+NslOXJ5mQILTPmo9bO9IjPegLRK8YnSX7KI8fyCGH9NRDL26MtELGN7VrVBOBc/7Zcn1HTavsbaaZuolckdwQQXKb7JUGeWd8GRFb/55k3AM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771019044; c=relaxed/simple; bh=mH50sMrriyGDz+Qbrz5Taix8L1V/wsCNQUq+G3Lfn6k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=UvcI7PysUAShS8q5o0EvQX1Ekyo/CltsV0fgkTT2uIxQlLsnnSFhqUy5BF6wMNedst93UXY1L2AWn9GmfB7rZRBJ7cN2WEHxbJSSDBTH15629CNMGju5PXO1BB8I/WWEwR4Rsc6dYnyFQXWXG3gpCV+poWCFc/vUO1Ni5sQvG1I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OSBGbuW3; arc=none smtp.client-ip=209.85.222.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OSBGbuW3" Received: by mail-qk1-f194.google.com with SMTP id af79cd13be357-8cb38e86cf2so154276585a.1 for ; Fri, 13 Feb 2026 13:44:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771019042; x=1771623842; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=yr4En5251tETgtYzeFZ5nnuFAQ7w2oyqC71nR7DQ8Wk=; b=OSBGbuW3mrtveKa3BUPWwguz082VtxBAxogv7TJtAsOESK/GDaEnQaU38h0xFcL8yp aCjruvhqv/XIIeAUv6C3vwMpQMEcVvaZZE9SExTAS1Qvqiz+Px0T26qdqdB4Py7vcIky DymGASomMQeiURX2nizVamPhsxWvfTfRbLzHmqC18/5AG/C4djQiX4+OCEY4z+fDLSA6 SS+guqnsrwBaUKP0r2wa+/v9C0jJs5vTtSdM9cEZpZJwN8j9hJC8QNeodkbv/QoHX1gZ Qb7JyMZgNzRBQjVLfnBplHLBPDEfNYomMYlYK/1whHQMK1Trz+/tkZAHOrOmt/7y1rLc XU9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771019042; x=1771623842; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yr4En5251tETgtYzeFZ5nnuFAQ7w2oyqC71nR7DQ8Wk=; b=oEZSAcbbO7UNYZCh/fnLh/V+Kf+gIQe6LLxpCUqYdze2J3kW/eZH6+8S2OWUH9jtXp ODTprX7C03GmqwrCeeWsnWhkp6+dnX0pABjT7lWGjVWYPl3EdqRRdCuxOny3UgzD9Iva laqXMppTbba5vJpzZ0YkhBi5UvQ3DFBMU1qzeWCl/BPpu7/y1VVk2o1XusXTsdFZABL+ V3B8ftLy8715GSPwKTnET4cBK8HbIYJ/o6yOjI3ZHEF8idKIpf2w6zDBAcqUvEwXWwYR GZBt/inb2zFVfnTbaf/1f30n+jpuCDjLoFx8KIJf1WjD/nFTA0z24NFbfXhBhttI2Hsk ALBA== X-Forwarded-Encrypted: i=1; AJvYcCWR+bRBCSeCmvRgpjLxFog6ybL1kwaM1seQlXISK1pKQOmd6gRlbkDFHs731T9+hrWou6cC82XwziD+fVY=@vger.kernel.org X-Gm-Message-State: AOJu0YymrASilU1YPVkIMLdf5NWn8wBjewvr2lXh4CW0M3sML3FbIP3P 1sNPc9/eRB6+Y5gIQj+/f+Ml0E+UCtFnHIa6aLOmS3ZY5Vtkm8o7WL0G8S7z1dH7 X-Gm-Gg: AZuq6aJIRu1eP7h4kunHfmC2Thc3HFREAok/zIwnRw2jgaXU/isCEMagJbX2aagmnAI 6hCrNWLAjrOT4n+a2IzO7HGwcC1sISZVR9bEkK4A+KQPIw6oMLXifG4P+BeKC+hofSpShNZtfj2 6YAdNPuFFvS7sPtC1cP9aqKDAKC0BDcpHtAS34gxfGnjCrn+XZaBYdzrsvYK6KBs4id8o1uqHTP r58tAQsS0vnoS8SaQb6v+y5QpIoNczZJCnO3oYJu0SMWPTzVjeEdnvD0zTxOLyPFBpWfsmkeU2x ja6IeEjgxCPYulIfaRRmO/2Lkzyn/dUoG32ZLoZ/zfeI1uPv/bWD9hD8EhI0vZwhlhwt2Uk1b/4 JjtFShaRg3qLLcnC4l8H0gDX60pVkXryuOq1W8x9O38NEV7xf3auKaC8zJ3TvVHkM/Zl07HDwqz ewHflG9Cz2diYiJUT4Go7rnK6JYTFScgSy X-Received: by 2002:a05:7022:618e:b0:11a:f5e0:dc8 with SMTP id a92af1059eb24-1273ae30dbemr1295141c88.28.1771012577689; Fri, 13 Feb 2026 11:56:17 -0800 (PST) Received: from [192.168.4.196] ([73.222.117.172]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1272a69cc93sm8742855c88.6.2026.02.13.11.56.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Feb 2026 11:56:17 -0800 (PST) Message-ID: Date: Fri, 13 Feb 2026 11:56:15 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] mm/mempolicy: track page allocations per mempolicy To: Vlastimil Babka , linux-mm@kvack.org Cc: apopple@nvidia.com, akpm@linux-foundation.org, axelrasmussen@google.com, byungchul@sk.com, cgroups@vger.kernel.org, david@kernel.org, eperezma@redhat.com, gourry@gourry.net, jasowang@redhat.com, hannes@cmpxchg.org, joshua.hahnjy@gmail.com, Liam.Howlett@oracle.com, linux-kernel@vger.kernel.org, lorenzo.stoakes@oracle.com, matthew.brost@intel.com, mst@redhat.com, mhocko@suse.com, rppt@kernel.org, muchun.song@linux.dev, zhengqi.arch@bytedance.com, rakie.kim@sk.com, roman.gushchin@linux.dev, shakeel.butt@linux.dev, surenb@google.com, virtualization@lists.linux.dev, weixugc@google.com, xuanzhuo@linux.alibaba.com, ying.huang@linux.alibaba.com, yuanchu@google.com, ziy@nvidia.com, kernel-team@meta.com References: <20260212045109.255391-1-inwardvessel@gmail.com> <20260212045109.255391-2-inwardvessel@gmail.com> <96b63efb-551f-4dd5-b4a2-ac67da577431@suse.cz> Content-Language: en-US From: "JP Kobryn (Meta)" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/13/26 12:54 AM, Vlastimil Babka wrote: > On 2/12/26 22:25, JP Kobryn wrote: >> On 2/12/26 7:24 AM, Vlastimil Babka wrote: >>> On 2/12/26 05:51, JP Kobryn wrote: >>>> It would be useful to see a breakdown of allocations to understand which >>>> NUMA policies are driving them. For example, when investigating memory >>>> pressure, having policy-specific counts could show that allocations were >>>> bound to the affected node (via MPOL_BIND). >>>> >>>> Add per-policy page allocation counters as new node stat items. These >>>> counters can provide correlation between a mempolicy and pressure on a >>>> given node. >>>> >>>> Signed-off-by: JP Kobryn >>>> Suggested-by: Johannes Weiner >>> >>> Are the numa_{hit,miss,etc.} counters insufficient? Could they be extended >>> in a way that would capture any missing important details? A counter per >>> policy type seems exhaustive, but then on one hand it might be not important >>> to distinguish beetween some of them, and on the other hand it doesn't track >>> the nodemask anyway. >> >> The two patches of the series should complement each other. When >> investigating memory pressure, we could identify the affected nodes >> (patch 2). Then we can cross-reference the policy-specific stats to find >> any correlation (this patch). >> >> I think extending numa_* counters would call for more permutations to >> account for the numa stat per policy. I think distinguishing between >> MPOL_DEFAULT and MPOL_BIND is meaningful, for example. Am I > > Are there other useful examples or would it be enough to add e.g. a > numa_bind counter to the numa_hit/miss/etc? Aside from bind, it's worth emphasizing that with default policy tracking we could see if the local node is the source of pressure. In the interleave case, we would be able to see if the loads are being balanced or, in the weighted case, being distributed properly. On extending the numa stats instead, I looked into this some more. I'm not sure if they're a good fit. They seem more about whether the allocator succeeded at placement rather than which policy drove the allocation. Thoughts? > What I'm trying to say the level of detail you are trying to add to the > always-on counters seems like more suitable for tracepoints. The counters > should be limited to what's known to be useful and not "everything we are > able to track and possibly could need one day". In a triage scenario, having the stats collected up to the time of the reported issue would be better. We make use of the tool called below[0]. It periodically samples the system and allows us to view the historical state prior to the issue. If we started at the time of the incident and attached tracepoints it would be too late. The triage workflow would look like this: 1) Pressure/OOMs reported while system-wide memory is free. 2) Check per-node pgscan/pgsteal stats (provided by patch 2) to narrow down node(s) under pressure. 3) Check per-policy allocation counters (this patch) on that node to find what policy was driving it. [0] https://github.com/facebookincubator/below