Re: Proposal to report GPU private memory allocations with sysfs nodes [plain text version]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rohan,

Thanks for your reply! We'd like the standardization to happen in the drm layer so it can be carried along, however, debugfs has already been deprecated in Android kernel and tracking per pid is most likely a doable solution only in the device driver layer. So...since we'd still like the low-cost run-time query system, we eventually end up doing the tracepoint[1] + eBPF solution. We standardized a gpu memory total tracepoint in upstream linux. Then the GPU vendors integrate into their kernel driver to track those global and per-process total counters. Then we wrote a bpf c program to track this tracepoint and maintain a map for the userspace to poke at.

Best regards,
Yiwei

[1] https://lore.kernel.org/lkml/20200302235044.59163-1-zzyiwei@xxxxxxxxxx



On Fri, Mar 20, 2020 at 5:07 AM Rohan Garg <rohan.garg@xxxxxxxxxxxxx> wrote:
Hi Yiwei
After some deliberation on how to move forward with my BO Labeling patches[1],
we've come up with the following structure for debugfs entries:

/debugfs/dri/128/bo/<handle>/label
/debugfs/dri/128/bo/<handle>/size

My initial idea was to count the total memory allocated for a particular label
in kernel space, but that turned out to be far too complicated to implement.
Which is why we decided to move towards something simpler and handle collating
this information on the userspace side of things.

Would this satisfy most of the Android  teams requirements? I understand that
it would leave out the memory tracking requirements tied to a specific PID,
but correct me if I'm wrong, would this not possible with gralloc on Android?

Cheers
Rohan Garg

[1] https://patchwork.freedesktop.org/patch/335508/?series=66752&rev=4

On lunes, 6 de enero de 2020 21:47:21 (CET) Yiwei Zhang wrote:
> Thanks, I'll check it out.
>
> Best,
> Yiwei
>
> On Mon, Jan 6, 2020 at 2:46 AM Rohan Garg <rohan.garg@xxxxxxxxxxxxx> wrote:
> > Hi Yiwei
> >
> > On jueves, 19 de diciembre de 2019 19:52:26 (CET) Yiwei Zhang wrote:
> > > Hi Rohan,
> > >
> > > Thanks for pointing out the pids issue! Then the index would be
> >
> > {namespace
> >
> > > + pid(in that namespace)}. I'll grab a setup and play with the driver to
> > > see what I can do. I know how to find an Intel or Freedreno setup, but
> >
> > I'd
> >
> > > still like to know is there a development friendly Mali setup?
> >
> > You should be able to setup a Mali T860 compatible device with this guide
> > [1].
> >
> > Cheers
> > Rohan Garg
> >
> > [1] https://panfrost.freedesktop.org/building-panfrost-mesa.html

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux