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 33163C71157 for ; Thu, 19 Jun 2025 00:26:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65C186B0092; Wed, 18 Jun 2025 20:26:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 60C3B6B009D; Wed, 18 Jun 2025 20:26:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FB406B00A0; Wed, 18 Jun 2025 20:26:25 -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 3C2886B0092 for ; Wed, 18 Jun 2025 20:26:25 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 99D9380F4E for ; Thu, 19 Jun 2025 00:26:24 +0000 (UTC) X-FDA: 83570258688.12.042769A Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.179]) by imf16.hostedemail.com (Postfix) with ESMTP id 6451C180002 for ; Thu, 19 Jun 2025 00:26:21 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=owdmuYtm; spf=pass (imf16.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.179 as permitted sender) smtp.mailfrom=shakeel.butt@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=1750292783; 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=nuhOj2JDkzQw/7zlAKVO2sNp6aWtcNRC5tsim0B+Biw=; b=SQSkxsJgZh0k6mJokr6OUUKwZ5NyIxGlK6aedDpEnQGHlgqfP+ElolCLknStJpb6/ZQoUi HHQpxJOR0R5TPJL2yorIM5+Gm3UxjQry39LNpEpB2ZzjpMU8xZA8gI/zGlERxu8vRUNyhA /v3HdsAWsZj8shlynARKyTeASbHEbNU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1750292783; a=rsa-sha256; cv=none; b=a63LEm3I/9yIHmm9QNsFUPqFmYApU+a/cKeW7+ocjzIigwLCjRKgdPqmK/XN5ZOixkJImF Cf6xE+qWTHN8KuuGFf+BD84XZiK0Ob5y7mQro/KZ/1Oi6Ma9UQh6dVMyHjpJmRdzkN+puw /mnd42s/kiAHbjp7dB6in9fhf7BB/cY= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=owdmuYtm; spf=pass (imf16.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.179 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Date: Wed, 18 Jun 2025 17:26:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1750292779; 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=nuhOj2JDkzQw/7zlAKVO2sNp6aWtcNRC5tsim0B+Biw=; b=owdmuYtmxGijCF8aj30nwEZFIvtSrofp4uTKtSyHtqqqyhHoFQZEeOFQBhzbjOyHxXXCGO 2hxOf55XeQ4rWKzeeIIwuKi/Nc6TkyMPswsjp5dnPgfe19tvUBESQbrZkfotYAGX8x69KG fVXgQzMAWejXuX7eVp/pWkKtn7PKjIg= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Dave Airlie Cc: dri-devel@lists.freedesktop.org, Dave Airlie , Christian Koenig , Matthew Brost , Johannes Weiner , linux-mm@kvack.org, Andrew Morton Subject: Re: [PATCH 1/2] mm: add gpu active/reclaim per-node stat counters Message-ID: <6yxpihotsrg73dmlr2fajga2b7qbdnsroi2tq7alohrqt56dx3@sjyoy4yg2ck7> References: <20250618040618.564650-1-airlied@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250618040618.564650-1-airlied@gmail.com> X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 6451C180002 X-Stat-Signature: oqrjseh8rttxjnen7tnkn6nxpp6fem3n X-Rspam-User: X-HE-Tag: 1750292781-934607 X-HE-Meta: U2FsdGVkX1+4dHsNIMTCkAHa1Gh848vdQ/yHhzOLYIW3h7LljarbaAq9NzJbGNRkgSV8gq6MuA1IXZIAQDIaBPG1A/+OHbfXDeKRWnPWrvoaSVnhVqEO/kR8rVzmOHMXqWr2lnpuyy8sCApgaeOsh3bkfplR6ysQisiJLqQKnZT0qkIwHD+il/LuSNIiieDu0Wbtz3qeQbw0jZEuNHPDM0LdZZOrlefEz9nuaOyp5FPyct1OUeviBxGm8QKxG09e2OTmTDBFlLvCMKNwaXgZi1id1jVY6ekr5wXaR9NOu/HsLwac4hjONzvq/Wmhi3Eggqw/s3Ai8n6HCaX7FkR7Xr3F6lOw197DweVLKU2LGfCLa/u9rxns8algjoXdLdRxwU69ikWsOynOtbZS3OM++JzuCL2fw6iUn5b1YCLWce7r+TvUyuNhcBNu4ECY99yh84vEICbPkg4lb/F+kHJrWe6jTpnMltkth1a8/O5oOzKWLeEIfQrUvZnVt7+K+Z/wxRomqGzAAhkYGDsj8nhhzMY51Cm9v0eHFwIPvvJPOXXv0o8n3sr7PUYPt1qAwxaHoqgFJw+whaNTT/g7aGDx69PJQNCMiKC8pVqIkQxKQTLDlQZI+w1QqDVDGyNKhe1buN//km7YXuZMndspSIJqYq0boRUW6rDYllkFAplfpdwgv1r612+Wo0EsnC5tINbD9LNgKhtQANg0GJM8TF6UZBlZGeRU2Hco0OMe3a6EXJqWVATGj69U+VsV7XT7AkG7/EiaUJR2j86847k445iRyjNPm7JtZ4xljkjBSiRleEpT9aAqlizKzSvx2gijVUrdSpOcWziWbFBWN4b7IvCHr/a6t9xHV296rcXBj9PBLhE= 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 18, 2025 at 02:06:17PM +1000, Dave Airlie wrote: > From: Dave Airlie > > While discussing memcg intergration with gpu memory allocations, > it was pointed out that there was no numa/system counters for > GPU memory allocations. > > With more integrated memory GPU server systems turning up, and > more requirements for memory tracking it seems we should start > closing the gap. > > Add two counters to track GPU per-node system memory allocations. > > The first is currently allocated to GPU objects, and the second > is for memory that is stored in GPU page pools that can be reclaimed, > by the shrinker. > > Cc: Christian Koenig > Cc: Matthew Brost > Cc: Johannes Weiner > Cc: linux-mm@kvack.org > Cc: Andrew Morton > Signed-off-by: Dave Airlie > > --- > > I'd like to get acks to merge this via the drm tree, if possible, > > Dave. > --- > Documentation/filesystems/proc.rst | 6 ++++++ > drivers/base/node.c | 5 +++++ > fs/proc/meminfo.c | 6 ++++++ > include/linux/mmzone.h | 2 ++ > mm/show_mem.c | 9 +++++++-- > mm/vmstat.c | 2 ++ > 6 files changed, 28 insertions(+), 2 deletions(-) > > diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst > index 5236cb52e357..45f61a19a790 100644 > --- a/Documentation/filesystems/proc.rst > +++ b/Documentation/filesystems/proc.rst > @@ -1095,6 +1095,8 @@ Example output. You may not have all of these fields. > CmaFree: 0 kB > Unaccepted: 0 kB > Balloon: 0 kB > + GPUActive: 0 kB > + GPUReclaim: 0 kB > HugePages_Total: 0 > HugePages_Free: 0 > HugePages_Rsvd: 0 > @@ -1273,6 +1275,10 @@ Unaccepted > Memory that has not been accepted by the guest > Balloon > Memory returned to Host by VM Balloon Drivers > +GPUActive > + Memory allocated to GPU objects > +GPUReclaim > + Memory in GPU allocator pools that is reclaimable Can you please explain a bit more about these GPUActive & GPUReclaim? Please correct me if I am wrong, GPUActive is the total memory used by GPU objects and GPUReclaim is the subset of GPUActive which is reclaimable (possibly through shrinkers).