RE: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-09-16 Thread Kasireddy, Vivek
Hi David, > >> I think it makes sense to have a generic (non-GUP) version of > >> check_and_migrate_movable_pages() available in migration.h that > >> drivers can use to ensure that they don't break memory hotunplug > >> accidentally. > > > > Definately not. > > > > Either use the VMA and

Re: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-09-14 Thread David Hildenbrand
I think it makes sense to have a generic (non-GUP) version of check_and_migrate_movable_pages() available in migration.h that drivers can use to ensure that they don't break memory hotunplug accidentally. Definately not. Either use the VMA and pin_user_pages(), or implement pin_user_pages_fd()

Re: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-08-30 Thread Jason Gunthorpe
On Sun, Aug 27, 2023 at 07:05:59PM +, Kasireddy, Vivek wrote: > Hi Jason, David, > > > > > Sure, we can simply always fail when we detect ZONE_MOVABLE or > > > MIGRATE_CMA. > > > > Maybe that keeps at least some use cases working. > > > > > > That seems fairly reasonable > > AFAICS, failing

RE: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-08-27 Thread Kasireddy, Vivek
Hi Jason, David, > > > Sure, we can simply always fail when we detect ZONE_MOVABLE or > > MIGRATE_CMA. > > > Maybe that keeps at least some use cases working. > > > > That seems fairly reasonable > AFAICS, failing udmabuf_create() if we detect one or more pages are in > ZONE_MOVABLE or

RE: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-08-27 Thread Kasireddy, Vivek
Hi Jason, David, > > > Sure, we can simply always fail when we detect ZONE_MOVABLE or > MIGRATE_CMA. > > Maybe that keeps at least some use cases working. > > That seems fairly reasonable AFAICS, failing udmabuf_create() if we detect one or more pages are in ZONE_MOVABLE or MIGRATE_CMA would

Re: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-08-25 Thread Jason Gunthorpe
On Thu, Aug 24, 2023 at 08:33:09PM +0200, David Hildenbrand wrote: > Sure, we can simply always fail when we detect ZONE_MOVABLE or MIGRATE_CMA. > Maybe that keeps at least some use cases working. That seems fairly reasonable Jason

Re: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-08-24 Thread David Hildenbrand
On 24.08.23 20:30, Jason Gunthorpe wrote: On Thu, Aug 24, 2023 at 08:30:17PM +0200, David Hildenbrand wrote: On 24.08.23 08:31, Kasireddy, Vivek wrote: Hi David, - Add a new API to the backing store/allocator to longterm-pin the page. For example, something along the lines of

Re: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-08-24 Thread Jason Gunthorpe
On Thu, Aug 24, 2023 at 08:30:17PM +0200, David Hildenbrand wrote: > On 24.08.23 08:31, Kasireddy, Vivek wrote: > > Hi David, > > > > > > > > > > - Add a new API to the backing store/allocator to longterm-pin the > > > > > page. > > > > > For example, something along the lines of > > >

Re: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-08-24 Thread David Hildenbrand
On 24.08.23 08:31, Kasireddy, Vivek wrote: Hi David, - Add a new API to the backing store/allocator to longterm-pin the page. For example, something along the lines of shmem_pin_mapping_page_longterm() for shmem as suggested by Daniel. A similar one needs to be added for

RE: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-08-24 Thread Kasireddy, Vivek
Hi David, > > >> - Add a new API to the backing store/allocator to longterm-pin the page. > >>For example, something along the lines of > shmem_pin_mapping_page_longterm() > >>for shmem as suggested by Daniel. A similar one needs to be added for > >>hugetlbfs as well. > > > > This

Re: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-08-23 Thread David Hildenbrand
- Add a new API to the backing store/allocator to longterm-pin the page. For example, something along the lines of shmem_pin_mapping_page_longterm() for shmem as suggested by Daniel. A similar one needs to be added for hugetlbfs as well. This may also be reasonable. Sounds reasonable

Re: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-08-22 Thread Jason Gunthorpe
On Tue, Aug 22, 2023 at 05:36:56AM +, Kasireddy, Vivek wrote: > Hi Jason, > > > > This patch series adds support for migrating pages associated with > > > a udmabuf out of the movable zone or CMA to avoid breaking features > > > such as memory hotunplug. > > > > > > The first patch exports

RE: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-08-21 Thread Kasireddy, Vivek
Hi Jason, > > This patch series adds support for migrating pages associated with > > a udmabuf out of the movable zone or CMA to avoid breaking features > > such as memory hotunplug. > > > > The first patch exports check_and_migrate_movable_pages() function > > out of GUP so that the udmabuf

Re: [PATCH v1 0/3] udmabuf: Add support for page migration out of movable zone or CMA

2023-08-17 Thread Jason Gunthorpe
On Wed, Aug 16, 2023 at 11:49:31PM -0700, Vivek Kasireddy wrote: > This patch series adds support for migrating pages associated with > a udmabuf out of the movable zone or CMA to avoid breaking features > such as memory hotunplug. > > The first patch exports check_and_migrate_movable_pages()