From: Mike Rapoport <rppt@kernel.org> To: Peter.Enderborg@sony.com 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, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, willy@infradead.org Subject: Re: [PATCH v5] dma-buf: Add DmaBufTotal counter in meminfo Date: Tue, 20 Apr 2021 14:52:26 +0300 [thread overview] Message-ID: <YH7AeqqNyNnY0Zi3@kernel.org> (raw) In-Reply-To: <b57a33a3-a5ed-c122-e5b9-c7e7c4dae35f@sony.com> On Tue, Apr 20, 2021 at 10:45:21AM +0000, Peter.Enderborg@sony.com wrote: > On 4/20/21 11:41 AM, Mike Rapoport wrote: > > Hello Peter, > > > > On Tue, Apr 20, 2021 at 09:26:00AM +0000, Peter.Enderborg@sony.com wrote: > >> On 4/20/21 10:58 AM, Daniel Vetter wrote: > >>> On Sat, Apr 17, 2021 at 06:38:35PM +0200, Peter Enderborg 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. > >>>> > >>>> Signed-off-by: Peter Enderborg <peter.enderborg@sony.com> > >>> So there have been tons of discussions around how to track dma-buf and > >>> why, and I really need to understand the use-cass here first I think. proc > >>> uapi is as much forever as anything else, and depending what you're doing > >>> this doesn't make any sense at all: > >>> > >>> - on most linux systems dma-buf are only instantiated for shared buffer. > >>> So there this gives you a fairly meaningless number and not anything > >>> reflecting gpu memory usage at all. > >>> > >>> - on Android all buffers are allocated through dma-buf afaik. But there > >>> we've recently had some discussions about how exactly we should track > >>> all this, and the conclusion was that most of this should be solved by > >>> cgroups long term. So if this is for Android, then I don't think adding > >>> random quick stop-gaps to upstream is a good idea (because it's a pretty > >>> long list of patches that have come up on this). > >>> > >>> So what is this for? > >> For the overview. dma-buf today only have debugfs for info. Debugfs > >> is not allowed by google to use in andoid. So this aggregate the information > >> so we can get information on what going on on the system. > > > > Can you send an example debugfs output to see what data are we talking > > about? > > Sure. This is on a idle system. Im not sure why you need it.The problem is partly that debugfs is > not accessable on a commercial device. I wanted to see what kind of information is there, but I didn't think it's that long :) > Dma-buf Objects: > size flags mode count exp_name buf name ino > 00032768 00000002 00080007 00000002 ion-system-1006-allocator-servi dmabuf17728 07400825 dmabuf17728 > Attached Devices: > Total 0 devices attached > > 11083776 00000002 00080007 00000003 ion-system-1006-allocator-servi dmabuf17727 07400824 dmabuf17727 > Attached Devices: > ae00000.qcom,mdss_mdp:qcom,smmu_sde_unsec_cb > Total 1 devices attached > > 00032768 00000002 00080007 00000002 ion-system-1006-allocator-servi dmabuf17726 07400823 dmabuf17726 > Attached Devices: > Total 0 devices attached > > 11083776 00000002 00080007 00000002 ion-system-1006-allocator-servi dmabuf17725 07400822 dmabuf17725 > Attached Devices: > ae00000.qcom,mdss_mdp:qcom,smmu_sde_unsec_cb > Total 1 devices attached ... > Total 654 objects, 744144896 bytes Isn't the size from the first column also available in fdinfo? Is there anything that prevents monitoring those? -- Sincerely yours, Mike.
WARNING: multiple messages have this Message-ID (diff)
From: Mike Rapoport <rppt@kernel.org> To: Peter.Enderborg@sony.com Cc: mhocko@suse.com, neilb@suse.de, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, adobriyan@gmail.com, linaro-mm-sig@lists.linaro.org, shakeelb@google.com, willy@infradead.org, samitolvanen@google.com, songmuchun@bytedance.com, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org, christian.koenig@amd.com, guro@fb.com, linux-media@vger.kernel.org Subject: Re: [PATCH v5] dma-buf: Add DmaBufTotal counter in meminfo Date: Tue, 20 Apr 2021 14:52:26 +0300 [thread overview] Message-ID: <YH7AeqqNyNnY0Zi3@kernel.org> (raw) In-Reply-To: <b57a33a3-a5ed-c122-e5b9-c7e7c4dae35f@sony.com> On Tue, Apr 20, 2021 at 10:45:21AM +0000, Peter.Enderborg@sony.com wrote: > On 4/20/21 11:41 AM, Mike Rapoport wrote: > > Hello Peter, > > > > On Tue, Apr 20, 2021 at 09:26:00AM +0000, Peter.Enderborg@sony.com wrote: > >> On 4/20/21 10:58 AM, Daniel Vetter wrote: > >>> On Sat, Apr 17, 2021 at 06:38:35PM +0200, Peter Enderborg 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. > >>>> > >>>> Signed-off-by: Peter Enderborg <peter.enderborg@sony.com> > >>> So there have been tons of discussions around how to track dma-buf and > >>> why, and I really need to understand the use-cass here first I think. proc > >>> uapi is as much forever as anything else, and depending what you're doing > >>> this doesn't make any sense at all: > >>> > >>> - on most linux systems dma-buf are only instantiated for shared buffer. > >>> So there this gives you a fairly meaningless number and not anything > >>> reflecting gpu memory usage at all. > >>> > >>> - on Android all buffers are allocated through dma-buf afaik. But there > >>> we've recently had some discussions about how exactly we should track > >>> all this, and the conclusion was that most of this should be solved by > >>> cgroups long term. So if this is for Android, then I don't think adding > >>> random quick stop-gaps to upstream is a good idea (because it's a pretty > >>> long list of patches that have come up on this). > >>> > >>> So what is this for? > >> For the overview. dma-buf today only have debugfs for info. Debugfs > >> is not allowed by google to use in andoid. So this aggregate the information > >> so we can get information on what going on on the system. > > > > Can you send an example debugfs output to see what data are we talking > > about? > > Sure. This is on a idle system. Im not sure why you need it.The problem is partly that debugfs is > not accessable on a commercial device. I wanted to see what kind of information is there, but I didn't think it's that long :) > Dma-buf Objects: > size flags mode count exp_name buf name ino > 00032768 00000002 00080007 00000002 ion-system-1006-allocator-servi dmabuf17728 07400825 dmabuf17728 > Attached Devices: > Total 0 devices attached > > 11083776 00000002 00080007 00000003 ion-system-1006-allocator-servi dmabuf17727 07400824 dmabuf17727 > Attached Devices: > ae00000.qcom,mdss_mdp:qcom,smmu_sde_unsec_cb > Total 1 devices attached > > 00032768 00000002 00080007 00000002 ion-system-1006-allocator-servi dmabuf17726 07400823 dmabuf17726 > Attached Devices: > Total 0 devices attached > > 11083776 00000002 00080007 00000002 ion-system-1006-allocator-servi dmabuf17725 07400822 dmabuf17725 > Attached Devices: > ae00000.qcom,mdss_mdp:qcom,smmu_sde_unsec_cb > Total 1 devices attached ... > Total 654 objects, 744144896 bytes Isn't the size from the first column also available in fdinfo? Is there anything that prevents monitoring those? -- Sincerely yours, Mike. _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2021-04-20 11:52 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-17 16:38 [PATCH v5] dma-buf: Add DmaBufTotal counter in meminfo Peter Enderborg 2021-04-17 16:38 ` Peter Enderborg 2021-04-20 8:58 ` Daniel Vetter 2021-04-20 8:58 ` Daniel Vetter 2021-04-20 9:26 ` Peter.Enderborg 2021-04-20 9:26 ` Peter.Enderborg 2021-04-20 9:41 ` Mike Rapoport 2021-04-20 9:41 ` Mike Rapoport 2021-04-20 10:45 ` Peter.Enderborg 2021-04-20 10:45 ` Peter.Enderborg 2021-04-20 11:52 ` Mike Rapoport [this message] 2021-04-20 11:52 ` Mike Rapoport 2021-04-20 12:03 ` Peter.Enderborg 2021-04-20 12:03 ` Peter.Enderborg 2021-04-20 11:14 ` Daniel Vetter 2021-04-20 11:14 ` Daniel Vetter 2021-04-20 11:37 ` Peter.Enderborg 2021-04-20 11:37 ` Peter.Enderborg 2021-04-21 9:15 ` Daniel Vetter 2021-04-21 9:15 ` Daniel Vetter 2021-04-21 10:37 ` Peter.Enderborg 2021-04-21 10:37 ` Peter.Enderborg 2021-04-21 10:57 ` Michal Hocko 2021-04-21 10:57 ` Michal Hocko 2021-04-21 13:05 ` Pekka Paalanen 2021-04-21 13:05 ` Pekka Paalanen 2021-04-21 15:31 ` Mike Rapoport 2021-04-21 15:31 ` Mike Rapoport 2021-04-21 17:35 ` Peter.Enderborg 2021-04-21 17:35 ` Peter.Enderborg 2021-04-22 8:06 ` Mike Rapoport 2021-04-22 8:06 ` Mike Rapoport 2021-04-22 14:08 ` Peter.Enderborg 2021-04-22 14:08 ` Peter.Enderborg 2021-04-25 7:33 ` Mike Rapoport 2021-04-25 7:33 ` Mike Rapoport 2021-04-25 8:40 ` Peter.Enderborg 2021-04-25 8:40 ` Peter.Enderborg
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=YH7AeqqNyNnY0Zi3@kernel.org \ --to=rppt@kernel.org \ --cc=Peter.Enderborg@sony.com \ --cc=adobriyan@gmail.com \ --cc=akpm@linux-foundation.org \ --cc=christian.koenig@amd.com \ --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=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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.