On 19 Jun 2025, at 3:20, Dave Airlie wrote:

> From: Dave Airlie <[email protected]>
>
> 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 <[email protected]>
> Cc: Matthew Brost <[email protected]>
> Cc: Johannes Weiner <[email protected]>
> Cc: [email protected]
> Cc: Andrew Morton <[email protected]>
> Signed-off-by: Dave Airlie <[email protected]>
>
> ---
>
> v2: add more info to the documentation on this memory.
>
> I'd like to get acks to merge this via the drm tree, if possible,
>
> Dave.
> ---
>  Documentation/filesystems/proc.rst | 8 ++++++++
>  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, 30 insertions(+), 2 deletions(-)
>

<snip>

> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index 283913d42d7b..458a3465dd8f 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -241,6 +241,8 @@ enum node_stat_item {
>       NR_HUGETLB,
>  #endif
>       NR_BALLOON_PAGES,
> +     NR_GPU_ACTIVE,          /* GPU pages assigned to an object */
> +     NR_GPU_RECLAIM,         /* GPU pages in shrinkable pools */

"GPU pages" seems confusing. These are not pages from GPU memory, right?
Would the comments below sound better?

/* Pages assigned to a GPU object */
/* Pages in shrinkable GPU pools */

Otherwise, Acked-by: Zi Yan <[email protected]>

--
Best Regards,
Yan, Zi

Reply via email to