linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Peter.Enderborg@sony.com>
To: <daniel@fooishbar.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
	<sumit.semwal@linaro.org>, <christian.koenig@amd.com>,
	<adobriyan@gmail.com>, <akpm@linux-foundation.org>,
	<songmuchun@bytedance.com>, <guro@fb.com>, <shakeelb@google.com>,
	<mhocko@suse.com>, <neilb@suse.de>, <samitolvanen@google.com>,
	<rppt@kernel.org>, <linux-media@vger.kernel.org>,
	<dri-devel@lists.freedesktop.org>,
	<linaro-mm-sig@lists.linaro.org>, <willy@infradead.org>
Subject: Re: [PATCH v2] dma-buf: Add DmaBufTotal counter in meminfo
Date: Tue, 20 Apr 2021 15:02:03 +0000	[thread overview]
Message-ID: <761db8ec-8d26-5472-123b-6ae76b4bec24@sony.com> (raw)
In-Reply-To: <CAPj87rNo2WS8A0BUoncZhZg4gMOcBrjOF5gxiAWrbpO6z1Rnqg@mail.gmail.com>

On 4/20/21 4:48 PM, Daniel Stone wrote:
> On Tue, 20 Apr 2021 at 14:46, <Peter.Enderborg@sony.com <mailto:Peter.Enderborg@sony.com>> wrote:
>
>     On 4/20/21 3:34 PM, Daniel Stone wrote:
>     > On Fri, 16 Apr 2021 at 13:34, Peter Enderborg <peter.enderborg@sony.com <mailto:peter.enderborg@sony.com> <mailto:peter.enderborg@sony.com <mailto:peter.enderborg@sony.com>>> wrote:
>     >     This adds a total used dma-buf memory. Details
>     >     can be found in debugfs, however it is not for everyone
>     >     and not always available. dma-buf are indirect allocated by
>     >     userspace. So with this value we can monitor and detect
>     >     userspace applications that have problems.
>     >
>     >
>     > FWIW, this won't work super well for Android where gralloc is implemented as a system service, so all graphics usage will instantly be accounted to it.
>
>     This resource allocation is a big part of why we need it. Why should it not work?
>
>
> Sorry, I'd somehow completely misread that as being locally rather than globally accounted. Given that, it's more correct, just also not super useful.
>
> Some drivers export allocation tracepoints which you could use if you have a decent userspace tracing infrastructure. Short of that, many drivers export this kind of thing through debugfs already. I think a better long-term direction is probably getting accounting from dma-heaps rather than extending core dmabuf itself.
>
> Cheers,
> Daniel 

Debugfs and traces are useful when you pin down your problem.  Debugfs does not exist on commercial devices so we need some hints on what going on, and trace points needs active debugging
and before the problem occurs. A metric on dma-buf can be sent with a bugreport.

      parent reply	other threads:[~2021-04-20 15:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 12:33 [PATCH v2] dma-buf: Add DmaBufTotal counter in meminfo Peter Enderborg
2021-04-16 12:46 ` Christian König
     [not found] ` <CAPj87rM9gaPS5SOHo3CKUU=5H0PDaG28r8BXimhVp-wmCbMvWA@mail.gmail.com>
2021-04-20 13:46   ` Peter.Enderborg
     [not found]     ` <CAPj87rNo2WS8A0BUoncZhZg4gMOcBrjOF5gxiAWrbpO6z1Rnqg@mail.gmail.com>
2021-04-20 15:02       ` Peter.Enderborg [this message]

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=761db8ec-8d26-5472-123b-6ae76b4bec24@sony.com \
    --to=peter.enderborg@sony.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@fooishbar.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=guro@fb.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=neilb@suse.de \
    --cc=rppt@kernel.org \
    --cc=samitolvanen@google.com \
    --cc=shakeelb@google.com \
    --cc=songmuchun@bytedance.com \
    --cc=sumit.semwal@linaro.org \
    --cc=willy@infradead.org \
    /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).