Re: [RFC v2 1/3] dma-buf: give each buffer a full-fledged inode

2019-03-26 Thread Joel Fernandes
On Mon, Mar 25, 2019 at 12:34:59PM -0700, Chenbo Feng wrote: [snip] > > > > Also what is the benefit of having st_blocks from stat? AFAIK, that is > > > > the > > > > same as the buffer's size which does not change for the lifetime of the > > > > buffer. In your patch you're doing this when 'struc

Re: [RFC v2 1/3] dma-buf: give each buffer a full-fledged inode

2019-03-26 Thread Chenbo Feng
On Sun, Mar 24, 2019 at 1:45 PM Joel Fernandes wrote: > > Hi Sandeep, > > On Sun, Mar 24, 2019 at 10:56:33AM -0700, Sandeep Patil wrote: > > On Fri, Mar 22, 2019 at 11:02:55AM -0400, Joel Fernandes wrote: > > > On Thu, Mar 21, 2019 at 07:51:33PM -0700, Chenbo Feng wrote: > > > > From: Greg Hackman

Re: [RFC v2 1/3] dma-buf: give each buffer a full-fledged inode

2019-03-25 Thread Erick Reyes
In the original userspace implementation Greg wrote, he was iterating the directory entries in proc//map_files, doing readlink() on each to find out whether the entry was a dmabuf. This turned out to be very slow so we reworked it to parse proc//maps instead. On Mon, Mar 25, 2019 at 12:35 PM Chen

Re: [RFC v2 1/3] dma-buf: give each buffer a full-fledged inode

2019-03-24 Thread Joel Fernandes
Hi Sandeep, On Sun, Mar 24, 2019 at 10:56:33AM -0700, Sandeep Patil wrote: > On Fri, Mar 22, 2019 at 11:02:55AM -0400, Joel Fernandes wrote: > > On Thu, Mar 21, 2019 at 07:51:33PM -0700, Chenbo Feng wrote: > > > From: Greg Hackmann > > > > > > By traversing /proc/*/fd and /proc/*/map_files, proc

Re: [RFC v2 1/3] dma-buf: give each buffer a full-fledged inode

2019-03-24 Thread Joel Fernandes
On Thu, Mar 21, 2019 at 07:51:33PM -0700, Chenbo Feng wrote: > From: Greg Hackmann > > By traversing /proc/*/fd and /proc/*/map_files, processes with CAP_ADMIN > can get a lot of fine-grained data about how shmem buffers are shared > among processes. stat(2) on each entry gives the caller a uniq

Re: [RFC v2 1/3] dma-buf: give each buffer a full-fledged inode

2019-03-24 Thread Sandeep Patil
On Fri, Mar 22, 2019 at 11:02:55AM -0400, Joel Fernandes wrote: > On Thu, Mar 21, 2019 at 07:51:33PM -0700, Chenbo Feng wrote: > > From: Greg Hackmann > > > > By traversing /proc/*/fd and /proc/*/map_files, processes with CAP_ADMIN > > can get a lot of fine-grained data about how shmem buffers ar

[RFC v2 1/3] dma-buf: give each buffer a full-fledged inode

2019-03-24 Thread Chenbo Feng
From: Greg Hackmann By traversing /proc/*/fd and /proc/*/map_files, processes with CAP_ADMIN can get a lot of fine-grained data about how shmem buffers are shared among processes. stat(2) on each entry gives the caller a unique ID (st_ino), the buffer's size (st_size), and even the number of pag