Re: Changing vma->vm_file in dma_buf_mmap()

2020-09-16 Thread Jason Gunthorpe
On Wed, Sep 16, 2020 at 11:53:59AM +0200, Daniel Vetter wrote: > But within the driver, we generally need thousands of these, and that > tends to bring fd exhaustion problems with it. That's why all the private > buffer objects which aren't shared with other process or other drivers are > handles

Re: Changing vma->vm_file in dma_buf_mmap()

2020-09-16 Thread Daniel Vetter
On Wed, Sep 16, 2020 at 4:14 PM Christian König wrote: > > Am 16.09.20 um 16:07 schrieb Jason Gunthorpe: > > On Wed, Sep 16, 2020 at 11:53:59AM +0200, Daniel Vetter wrote: > > > >> But within the driver, we generally need thousands of these, and that > >> tends to bring fd exhaustion problems with

Re: Changing vma->vm_file in dma_buf_mmap()

2020-09-16 Thread Christian König
Am 16.09.20 um 16:07 schrieb Jason Gunthorpe: On Wed, Sep 16, 2020 at 11:53:59AM +0200, Daniel Vetter wrote: But within the driver, we generally need thousands of these, and that tends to bring fd exhaustion problems with it. That's why all the private buffer objects which aren't shared with ot

Re: Changing vma->vm_file in dma_buf_mmap()

2020-09-16 Thread Daniel Vetter
On Wed, Sep 16, 2020 at 1:45 PM Christian König wrote: > > [SNIP] > > But Jason pointed me to the right piece of code. See this comment in in > mmap_region(): > > /* ->mmap() can change vma->vm_file, but must guarantee that > * vma_link() below can deny write-access if VM_DENYWRITE is set > * and

Re: Changing vma->vm_file in dma_buf_mmap()

2020-09-16 Thread Christian König
[SNIP] But Jason pointed me to the right piece of code. See this comment in in mmap_region(): /* ->mmap() can change vma->vm_file, but must guarantee that * vma_link() below can deny write-access if VM_DENYWRITE is set * and map writably if VM_SHARED is set. This usually means

Re: Changing vma->vm_file in dma_buf_mmap()

2020-09-16 Thread Christian König
Am 16.09.20 um 11:53 schrieb Daniel Vetter: On Mon, Sep 14, 2020 at 08:26:47PM +0200, Christian König wrote: Am 14.09.20 um 16:06 schrieb Jason Gunthorpe: On Mon, Sep 14, 2020 at 03:30:47PM +0200, Christian König wrote: Am 14.09.20 um 15:29 schrieb Christian König: Hi Andrew, I'm the new DMA

Re: Changing vma->vm_file in dma_buf_mmap()

2020-09-16 Thread Daniel Vetter
On Mon, Sep 14, 2020 at 08:26:47PM +0200, Christian König wrote: > Am 14.09.20 um 16:06 schrieb Jason Gunthorpe: > > On Mon, Sep 14, 2020 at 03:30:47PM +0200, Christian König wrote: > > > Am 14.09.20 um 15:29 schrieb Christian König: > > > > Hi Andrew, > > > > > > > > I'm the new DMA-buf maintaine

Re: Changing vma->vm_file in dma_buf_mmap()

2020-09-15 Thread Jason Gunthorpe
On Mon, Sep 14, 2020 at 03:30:47PM +0200, Christian König wrote: > Am 14.09.20 um 15:29 schrieb Christian König: > > Hi Andrew, > > > > I'm the new DMA-buf maintainer and Daniel and others came up with > > patches extending the use of the dma_buf_mmap() function. > > > > Now this function is doin

Re: Changing vma->vm_file in dma_buf_mmap()

2020-09-14 Thread Christian König
Am 14.09.20 um 16:06 schrieb Jason Gunthorpe: On Mon, Sep 14, 2020 at 03:30:47PM +0200, Christian König wrote: Am 14.09.20 um 15:29 schrieb Christian König: Hi Andrew, I'm the new DMA-buf maintainer and Daniel and others came up with patches extending the use of the dma_buf_mmap() function. N

Re: Changing vma->vm_file in dma_buf_mmap()

2020-09-14 Thread Christian König
Am 14.09.20 um 15:29 schrieb Christian König: Hi Andrew, Sorry forgot to add Daniel as well. I'm the new DMA-buf maintainer and Daniel and others came up with patches extending the use of the dma_buf_mmap() function. Now this function is doing something a bit odd by changing the vma->vm_fi