dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Yiwei Zhang <zzyiwei@google.com>
To: Rohan Garg <rohan.garg@collabora.com>
Cc: Alistair Delva <adelva@google.com>,
	Prahlad Kilambi <prahladk@google.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Jerome Glisse <jglisse@redhat.com>, Kenny Ho <y2kenny@gmail.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Sean Paul <seanpaul@chromium.org>,
	Chris Forbes <chrisforbes@google.com>,
	Android Kernel Team <kernel-team@android.com>
Subject: Re: Proposal to report GPU private memory allocations with sysfs nodes [plain text version]
Date: Fri, 20 Mar 2020 14:35:25 -0700	[thread overview]
Message-ID: <CAKT=dD=L8T6vC3N6-ntGmA0qbAULmLv0a81rRS4VSVzC-zL3Kg@mail.gmail.com> (raw)
In-Reply-To: <12494517.uLZWGnKmhe@solembum>


[-- Attachment #1.1: Type: text/plain, Size: 2636 bytes --]

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@google.com



On Fri, Mar 20, 2020 at 5:07 AM Rohan Garg <rohan.garg@collabora.com> 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@collabora.com>
> 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
>
>

[-- Attachment #1.2: Type: text/html, Size: 3740 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

  reply	other threads:[~2020-03-21 10:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25 18:35 Proposal to report GPU private memory allocations with sysfs nodes [plain text version] Yiwei Zhang
2019-10-28 15:26 ` Jerome Glisse
2019-10-28 18:33   ` Yiwei Zhang
2019-10-29  1:19     ` Yiwei Zhang
2019-10-31  5:23       ` Kenny Ho
2019-10-31 16:59         ` Yiwei Zhang
2019-10-31 17:57           ` Kenny Ho
2019-11-01  8:36             ` Pekka Paalanen
2019-11-04 19:34               ` Yiwei Zhang
2019-11-05  9:47                 ` Daniel Vetter
2019-11-05 19:45                   ` Yiwei Zhang
2019-11-06  9:56                     ` Daniel Vetter
2019-11-06 16:55                   ` Rob Clark
2019-11-06 19:21                     ` Yiwei Zhang
2019-11-12 18:17                       ` Yiwei Zhang
2019-11-12 20:18                         ` Jerome Glisse
2019-11-15  1:02                           ` Yiwei Zhang
2019-12-13 22:09                             ` Yiwei Zhang
2019-12-19 16:18                             ` Rohan Garg
2019-12-19 18:52                               ` Yiwei Zhang
2020-01-06 10:46                                 ` Rohan Garg
2020-01-06 20:47                                   ` Yiwei Zhang
2020-03-20 12:07                                     ` Rohan Garg
2020-03-20 21:35                                       ` Yiwei Zhang [this message]
2019-10-29  8:33     ` Pekka Paalanen
2019-10-30 21:03       ` Yiwei Zhang
2019-10-30 22:06         ` Yiwei Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKT=dD=L8T6vC3N6-ntGmA0qbAULmLv0a81rRS4VSVzC-zL3Kg@mail.gmail.com' \
    --to=zzyiwei@google.com \
    --cc=adelva@google.com \
    --cc=chrisforbes@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jglisse@redhat.com \
    --cc=kernel-team@android.com \
    --cc=kraxel@redhat.com \
    --cc=prahladk@google.com \
    --cc=rohan.garg@collabora.com \
    --cc=seanpaul@chromium.org \
    --cc=y2kenny@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).