Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-08-08 Thread Daniel Vetter
On Thu, Jun 22, 2023 at 10:25:17AM +0200, David Hildenbrand wrote: > On 22.06.23 09:27, Vivek Kasireddy wrote: > > The first patch ensures that the mappings needed for handling mmap > > operation would be managed by using the pfn instead of struct page. > > The second patch restores support for map

RE: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-28 Thread Kasireddy, Vivek
Hi David, > > On 27.06.23 08:37, Kasireddy, Vivek wrote: > > Hi David, > > > > Hi! > > sorry for taking a bit longer to reply lately. No problem. > > [...] > > >>> Sounds right, maybe it needs to go back to the old GUP solution, though, > as > >>> mmu notifiers are also mm-based not fd-based

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-27 Thread Jason Gunthorpe
On Tue, Jun 27, 2023 at 12:00:38PM -0400, Peter Xu wrote: > On Tue, Jun 27, 2023 at 12:52:34PM -0300, Jason Gunthorpe wrote: > > On Mon, Jun 26, 2023 at 03:04:21PM -0400, Peter Xu wrote: > > > On Mon, Jun 26, 2023 at 03:18:48PM -0300, Jason Gunthorpe wrote: > > > > On Mon, Jun 26, 2023 at 08:14:27P

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-27 Thread Peter Xu
On Tue, Jun 27, 2023 at 12:52:34PM -0300, Jason Gunthorpe wrote: > On Mon, Jun 26, 2023 at 03:04:21PM -0400, Peter Xu wrote: > > On Mon, Jun 26, 2023 at 03:18:48PM -0300, Jason Gunthorpe wrote: > > > On Mon, Jun 26, 2023 at 08:14:27PM +0200, David Hildenbrand wrote: > > > > > > > So we might have

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-27 Thread Jason Gunthorpe
On Mon, Jun 26, 2023 at 03:04:21PM -0400, Peter Xu wrote: > On Mon, Jun 26, 2023 at 03:18:48PM -0300, Jason Gunthorpe wrote: > > On Mon, Jun 26, 2023 at 08:14:27PM +0200, David Hildenbrand wrote: > > > > > So we might have to implement the same page migration as gup does on > > > FOLL_LONGTERM her

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-27 Thread David Hildenbrand
On 27.06.23 08:37, Kasireddy, Vivek wrote: Hi David, Hi! sorry for taking a bit longer to reply lately. [...] Sounds right, maybe it needs to go back to the old GUP solution, though, as mmu notifiers are also mm-based not fd-based. Or to be explicit, I think it'll be pin_user_pages(FOLL_LO

RE: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-26 Thread Kasireddy, Vivek
Hi David, > On 26.06.23 19:52, Peter Xu wrote: > > On Mon, Jun 26, 2023 at 07:45:37AM +, Kasireddy, Vivek wrote: > >> Hi Peter, > >> > >>> > >>> On Fri, Jun 23, 2023 at 06:13:02AM +, Kasireddy, Vivek wrote: > Hi David, > > >> The first patch ensures that the mappings needed f

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-26 Thread Peter Xu
On Mon, Jun 26, 2023 at 03:18:48PM -0300, Jason Gunthorpe wrote: > On Mon, Jun 26, 2023 at 08:14:27PM +0200, David Hildenbrand wrote: > > > So we might have to implement the same page migration as gup does on > > FOLL_LONGTERM here ... maybe there are more such cases/drivers that actually > > requ

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-26 Thread Jason Gunthorpe
On Mon, Jun 26, 2023 at 08:14:27PM +0200, David Hildenbrand wrote: > So we might have to implement the same page migration as gup does on > FOLL_LONGTERM here ... maybe there are more such cases/drivers that actually > require that handling when simply taking pages out of the memfd, believing > th

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-26 Thread David Hildenbrand
On 26.06.23 19:52, Peter Xu wrote: On Mon, Jun 26, 2023 at 07:45:37AM +, Kasireddy, Vivek wrote: Hi Peter, On Fri, Jun 23, 2023 at 06:13:02AM +, Kasireddy, Vivek wrote: Hi David, The first patch ensures that the mappings needed for handling mmap operation would be managed by using

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-26 Thread Peter Xu
On Mon, Jun 26, 2023 at 07:45:37AM +, Kasireddy, Vivek wrote: > Hi Peter, > > > > > On Fri, Jun 23, 2023 at 06:13:02AM +, Kasireddy, Vivek wrote: > > > Hi David, > > > > > > > > The first patch ensures that the mappings needed for handling mmap > > > > > operation would be managed by usin

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-26 Thread Jason Gunthorpe
On Fri, Jun 23, 2023 at 01:28:24PM -0400, Peter Xu wrote: > On Fri, Jun 23, 2023 at 01:37:58PM -0300, Jason Gunthorpe wrote: > > On Fri, Jun 23, 2023 at 12:35:45PM -0400, Peter Xu wrote: > > > > > It seems the previous concern on using gup was majorly fork(), if this is > > > it: > > > > > > htt

RE: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-26 Thread Kasireddy, Vivek
Hi Peter, > > On Fri, Jun 23, 2023 at 06:13:02AM +, Kasireddy, Vivek wrote: > > Hi David, > > > > > > The first patch ensures that the mappings needed for handling mmap > > > > operation would be managed by using the pfn instead of struct page. > > > > The second patch restores support for ma

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-23 Thread Peter Xu
On Fri, Jun 23, 2023 at 01:37:58PM -0300, Jason Gunthorpe wrote: > On Fri, Jun 23, 2023 at 12:35:45PM -0400, Peter Xu wrote: > > > It seems the previous concern on using gup was majorly fork(), if this is > > it: > > > > https://patchwork.freedesktop.org/patch/210992/?series=39879&rev=2#comment_

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-23 Thread Jason Gunthorpe
On Fri, Jun 23, 2023 at 12:35:45PM -0400, Peter Xu wrote: > It seems the previous concern on using gup was majorly fork(), if this is it: > > https://patchwork.freedesktop.org/patch/210992/?series=39879&rev=2#comment_414213 Fork and GUP have been fixed since that comment anyhow there is no longe

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-23 Thread Peter Xu
On Fri, Jun 23, 2023 at 06:13:02AM +, Kasireddy, Vivek wrote: > Hi David, > > > > The first patch ensures that the mappings needed for handling mmap > > > operation would be managed by using the pfn instead of struct page. > > > The second patch restores support for mapping hugetlb pages where

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-23 Thread Mike Kravetz
On 06/22/23 10:25, David Hildenbrand wrote: > On 22.06.23 09:27, Vivek Kasireddy wrote: > > There are *probably* more issues on the QEMU side when udmabuf is paired > with things like MADV_DONTNEED/FALLOC_FL_PUNCH_HOLE used for virtio-balloon, > virtio-mem, postcopy live migration, ... for example

RE: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-22 Thread Kasireddy, Vivek
Hi David, > > The first patch ensures that the mappings needed for handling mmap > > operation would be managed by using the pfn instead of struct page. > > The second patch restores support for mapping hugetlb pages where > > subpages of a hugepage are not directly used anymore (main reason > > f

Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-22 Thread David Hildenbrand
On 22.06.23 09:27, Vivek Kasireddy wrote: The first patch ensures that the mappings needed for handling mmap operation would be managed by using the pfn instead of struct page. The second patch restores support for mapping hugetlb pages where subpages of a hugepage are not directly used anymore (

[PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages

2023-06-22 Thread Vivek Kasireddy
The first patch ensures that the mappings needed for handling mmap operation would be managed by using the pfn instead of struct page. The second patch restores support for mapping hugetlb pages where subpages of a hugepage are not directly used anymore (main reason for revert) and instead the huge