Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-02-03 Thread Daniel Vetter
On Fri, Jan 29, 2021 at 03:22:06PM +0100, Christian König wrote: > Am 29.01.21 um 15:17 schrieb Simon Ser: > > On Friday, January 29th, 2021 at 3:13 PM, Pekka Paalanen > > wrote: > > > > > > Re-importing it adds quite a huge CPU overhead to both userspace as well > > > > as the kernel. > > > Per

Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-28 Thread Pekka Paalanen
On Wed, 27 Jan 2021 12:01:55 +0100 Christian König wrote: > Somewhat correct. This interface here really doesn't make sense since > the file descriptor representation of DMA-buf is only meant to be used > for short term usage. > > E.g. the idea is that you can export a DMA-buf fd from your dev

Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-27 Thread Kalesh Singh
On Wed, Jan 27, 2021 at 5:47 AM Jann Horn wrote: > > +jeffv from Android > > On Tue, Jan 26, 2021 at 11:51 PM Kalesh Singh wrote: > > In order to measure how much memory a process actually consumes, it is > > necessary to include the DMA buffer sizes for that process in the memory > > accounting.

Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-27 Thread Michal Hocko
On Wed 27-01-21 12:01:55, Christian König wrote: [...] > Some years ago I've proposed an change to improve the OOM killer to take > into account how much memory is reference through special file descriptors > like device drivers or DMA-buf. > > But that never want anywhere because of concerns that

Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-27 Thread Michal Hocko
On Wed 27-01-21 12:08:50, Christian König wrote: > Am 27.01.21 um 12:02 schrieb Michal Hocko: > > On Wed 27-01-21 11:53:55, Christian König wrote: > > [...] > > > In general processes are currently not held accountable for memory they > > > reference through their file descriptors. DMA-buf is just

Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-27 Thread Christian König
Am 27.01.21 um 12:02 schrieb Michal Hocko: On Wed 27-01-21 11:53:55, Christian König wrote: [...] In general processes are currently not held accountable for memory they reference through their file descriptors. DMA-buf is just one special case. True In other words you can currently do someth

Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-27 Thread Michal Hocko
On Wed 27-01-21 11:53:55, Christian König wrote: [...] > In general processes are currently not held accountable for memory they > reference through their file descriptors. DMA-buf is just one special case. True > In other words you can currently do something like this > > fd = memfd_create("tes

Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-27 Thread Christian König
Am 27.01.21 um 11:57 schrieb Michal Hocko: On Wed 27-01-21 11:47:29, Jann Horn wrote: +jeffv from Android On Tue, Jan 26, 2021 at 11:51 PM Kalesh Singh wrote: In order to measure how much memory a process actually consumes, it is necessary to include the DMA buffer sizes for that process in t

Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-27 Thread Michal Hocko
On Wed 27-01-21 11:47:29, Jann Horn wrote: > +jeffv from Android > > On Tue, Jan 26, 2021 at 11:51 PM Kalesh Singh wrote: > > In order to measure how much memory a process actually consumes, it is > > necessary to include the DMA buffer sizes for that process in the memory > > accounting. Since t

Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-27 Thread Christian König
Am 27.01.21 um 10:05 schrieb Michal Hocko: [Cc linux-api as this is a new user interface] On Tue 26-01-21 22:51:28, Kalesh Singh wrote: In order to measure how much memory a process actually consumes, it is necessary to include the DMA buffer sizes for that process in the memory accounting. Sin

Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-27 Thread Jann Horn
+jeffv from Android On Tue, Jan 26, 2021 at 11:51 PM Kalesh Singh wrote: > In order to measure how much memory a process actually consumes, it is > necessary to include the DMA buffer sizes for that process in the memory > accounting. Since the handle to DMA buffers are raw FDs, it is important >

[PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-27 Thread Kalesh Singh
In order to measure how much memory a process actually consumes, it is necessary to include the DMA buffer sizes for that process in the memory accounting. Since the handle to DMA buffers are raw FDs, it is important to be able to identify which processes have FD references to a DMA buffer. Curren

Re: [PATCH] procfs/dmabuf: Add /proc//task//dmabuf_fds

2021-01-27 Thread Michal Hocko
[Cc linux-api as this is a new user interface] On Tue 26-01-21 22:51:28, Kalesh Singh wrote: > In order to measure how much memory a process actually consumes, it is > necessary to include the DMA buffer sizes for that process in the memory > accounting. Since the handle to DMA buffers are raw FDs