Re: [PATCH v2] Add gpu memory tracepoints

Yiwei Zhang
2020-02-13T01:23:42Z

Hi Greg,

Thanks for your prompt response!

For upstream drm gem based gfx drivers, the lower level device driver
layer is able to implement such per-process gpu memory total counters
but the common drm gem layer is probably not. At least the global
total gpu memory counter is fairly easy to implement, and then this
tracepoint can still be useful right away.

For Android, the debugfs has already been forced to be deprecated in
the coming Android 11 release. We have asked Android GPU vendors to
implement such global and per-process total memory counters. So they
can easily use this tracepoint inside the driver. This is mainly to
serve the profiling needs as well as the runtime query needs(by
attaching a eBPF program from userspace), and this patch helps
standardize the tracepoint in the kernel.

Many thanks!
Yiwei

On Wed, Feb 12, 2020 at 4:40 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Wed, Feb 12, 2020 at 04:32:59PM -0800, zzyiwei@google.com wrote:
> > From: Yiwei Zhang <zzyiwei@google.com>
> >
> > This change adds the below gpu memory tracepoint:
> > gpu_mem/gpu_mem_total: track global or process gpu memory total counters
> >
> > Signed-off-by: Yiwei Zhang <zzyiwei@google.com>
>
> If this helps gpu drivers wean themselves off of debugfs, I am all for
> it:
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> Thanks for doing this.
>
> greg k-h