Re: [PATCH 1/1] dma-buf: heaps: Map system heap pages as managed by linux vm

2021-02-02 Thread Suren Baghdasaryan
On Tue, Feb 2, 2021 at 12:51 AM Christoph Hellwig wrote: > > On Tue, Feb 02, 2021 at 12:44:44AM -0800, Suren Baghdasaryan wrote: > > On Mon, Feb 1, 2021 at 11:03 PM Christoph Hellwig > > wrote: > > > > > > IMHO the > > > > > > BUG_ON(vma->vm_flags & VM_PFNMAP); > > > > > > in vm_insert_p

Re: [PATCH 1/1] dma-buf: heaps: Map system heap pages as managed by linux vm

2021-02-02 Thread Christoph Hellwig
On Tue, Feb 02, 2021 at 12:44:44AM -0800, Suren Baghdasaryan wrote: > On Mon, Feb 1, 2021 at 11:03 PM Christoph Hellwig wrote: > > > > IMHO the > > > > BUG_ON(vma->vm_flags & VM_PFNMAP); > > > > in vm_insert_page should just become a WARN_ON_ONCE with an error > > return, and then we just

Re: [PATCH 1/1] dma-buf: heaps: Map system heap pages as managed by linux vm

2021-02-02 Thread Suren Baghdasaryan
On Mon, Feb 1, 2021 at 11:03 PM Christoph Hellwig wrote: > > IMHO the > > BUG_ON(vma->vm_flags & VM_PFNMAP); > > in vm_insert_page should just become a WARN_ON_ONCE with an error > return, and then we just need to gradually fix up the callers that > trigger it instead of coming up with wor

Re: [PATCH 1/1] dma-buf: heaps: Map system heap pages as managed by linux vm

2021-02-01 Thread Christoph Hellwig
IMHO the BUG_ON(vma->vm_flags & VM_PFNMAP); in vm_insert_page should just become a WARN_ON_ONCE with an error return, and then we just need to gradually fix up the callers that trigger it instead of coming up with workarounds like this.

Re: [PATCH 1/1] dma-buf: heaps: Map system heap pages as managed by linux vm

2021-02-01 Thread Suren Baghdasaryan
On Thu, Jan 28, 2021 at 11:00 AM Suren Baghdasaryan wrote: > > On Thu, Jan 28, 2021 at 10:19 AM Minchan Kim wrote: > > > > On Thu, Jan 28, 2021 at 09:52:59AM -0800, Suren Baghdasaryan wrote: > > > On Thu, Jan 28, 2021 at 1:13 AM Christoph Hellwig > > > wrote: > > > > > > > > On Thu, Jan 28, 202

Re: [PATCH 1/1] dma-buf: heaps: Map system heap pages as managed by linux vm

2021-01-28 Thread Minchan Kim
On Thu, Jan 28, 2021 at 09:52:59AM -0800, Suren Baghdasaryan wrote: > On Thu, Jan 28, 2021 at 1:13 AM Christoph Hellwig wrote: > > > > On Thu, Jan 28, 2021 at 12:38:17AM -0800, Suren Baghdasaryan wrote: > > > Currently system heap maps its buffers with VM_PFNMAP flag using > > > remap_pfn_range. T

Re: [PATCH 1/1] dma-buf: heaps: Map system heap pages as managed by linux vm

2021-01-28 Thread Suren Baghdasaryan
On Thu, Jan 28, 2021 at 1:13 AM Christoph Hellwig wrote: > > On Thu, Jan 28, 2021 at 12:38:17AM -0800, Suren Baghdasaryan wrote: > > Currently system heap maps its buffers with VM_PFNMAP flag using > > remap_pfn_range. This results in such buffers not being accounted > > for in PSS calculations be

Re: [PATCH 1/1] dma-buf: heaps: Map system heap pages as managed by linux vm

2021-01-28 Thread Christoph Hellwig
On Thu, Jan 28, 2021 at 12:38:17AM -0800, Suren Baghdasaryan wrote: > Currently system heap maps its buffers with VM_PFNMAP flag using > remap_pfn_range. This results in such buffers not being accounted > for in PSS calculations because vm treats this memory as having no > page structs. Without pag

Re: [PATCH 1/1] dma-buf: heaps: Map system heap pages as managed by linux vm

2021-01-28 Thread Suren Baghdasaryan
On Thu, Jan 28, 2021 at 12:38 AM Suren Baghdasaryan wrote: > > Currently system heap maps its buffers with VM_PFNMAP flag using > remap_pfn_range. This results in such buffers not being accounted > for in PSS calculations because vm treats this memory as having no > page structs. Without page stru

[PATCH 1/1] dma-buf: heaps: Map system heap pages as managed by linux vm

2021-01-28 Thread Suren Baghdasaryan
Currently system heap maps its buffers with VM_PFNMAP flag using remap_pfn_range. This results in such buffers not being accounted for in PSS calculations because vm treats this memory as having no page structs. Without page structs there are no counters representing how many processes are mapping