Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-14 Thread Michal Hocko
On Mon 14-12-20 15:21:21, David Hildenbrand wrote: > On 14.12.20 14:36, Jason Gunthorpe wrote: > > On Sat, Dec 12, 2020 at 08:29:11AM +0100, David Hildenbrand wrote: > > > >>> Racing with another GUP in another thread is also not reasonable, so > >>> failing to isolate can't be a failure > >> >

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-14 Thread David Hildenbrand
On 14.12.20 14:36, Jason Gunthorpe wrote: > On Sat, Dec 12, 2020 at 08:29:11AM +0100, David Hildenbrand wrote: > >>> Racing with another GUP in another thread is also not reasonable, so >>> failing to isolate can't be a failure >> >> Having VMs with multiple vfio containers is certainly

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-14 Thread Michal Hocko
On Fri 11-12-20 15:21:39, Pavel Tatashin wrote: [...] > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index b593316bff3d..25c0c13ba4b1 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -386,9 +386,14 @@ enum zone_type { >* likely to succeed, and to

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-14 Thread Jason Gunthorpe
On Sat, Dec 12, 2020 at 08:29:11AM +0100, David Hildenbrand wrote: > > Racing with another GUP in another thread is also not reasonable, so > > failing to isolate can't be a failure > > Having VMs with multiple vfio containers is certainly realistic, and > optimizing in user space to do vfio

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-12 Thread David Hildenbrand
> Am 12.12.2020 um 00:50 schrieb Jason Gunthorpe : > > On Fri, Dec 11, 2020 at 10:53:00PM +0100, David Hildenbrand wrote: > >>> When check_and_migrate_movable_pages() is called, the pages are >>> already pinned. If some of those pages are in movable zone, and we >>> fail to migrate or isolate

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-11 Thread John Hubbard
On 12/11/20 3:00 PM, Pavel Tatashin wrote: I guess revert what we did (unpin) and return an error. The interesting question is what can make migration/isolation fail OK. I will make the necessary changes. Let's handle errors properly. Whatever the cause for the error, we will know it when it

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-11 Thread Jason Gunthorpe
On Fri, Dec 11, 2020 at 10:53:00PM +0100, David Hildenbrand wrote: > > When check_and_migrate_movable_pages() is called, the pages are > > already pinned. If some of those pages are in movable zone, and we > > fail to migrate or isolate them what should we do: proceed, and > > keep it as

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-11 Thread Pavel Tatashin
> I guess revert what we did (unpin) and return an error. The interesting > question is what can make migration/isolation fail OK. I will make the necessary changes. Let's handle errors properly. Whatever the cause for the error, we will know it when it happens, and when error is returned. I

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-11 Thread David Hildenbrand
> Am 11.12.2020 um 22:36 schrieb Pavel Tatashin : > > On Fri, Dec 11, 2020 at 4:29 PM David Hildenbrand wrote: >> >> Am 11.12.2020 um 22:09 schrieb Pavel Tatashin : >>> >>> On Fri, Dec 11, 2020 at 3:46 PM Jason Gunthorpe wrote: > On Fri, Dec 11, 2020 at 03:40:57PM -0500,

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-11 Thread Pavel Tatashin
On Fri, Dec 11, 2020 at 4:29 PM David Hildenbrand wrote: > > > > Am 11.12.2020 um 22:09 schrieb Pavel Tatashin : > > > > On Fri, Dec 11, 2020 at 3:46 PM Jason Gunthorpe wrote: > >> > >>> On Fri, Dec 11, 2020 at 03:40:57PM -0500, Pavel Tatashin wrote: > >>> On Fri, Dec 11, 2020 at 3:23 PM Jason

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-11 Thread David Hildenbrand
> Am 11.12.2020 um 22:09 schrieb Pavel Tatashin : > > On Fri, Dec 11, 2020 at 3:46 PM Jason Gunthorpe wrote: >> >>> On Fri, Dec 11, 2020 at 03:40:57PM -0500, Pavel Tatashin wrote: >>> On Fri, Dec 11, 2020 at 3:23 PM Jason Gunthorpe wrote: On Fri, Dec 11, 2020 at 03:21:39PM -0500,

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-11 Thread Pavel Tatashin
On Fri, Dec 11, 2020 at 3:46 PM Jason Gunthorpe wrote: > > On Fri, Dec 11, 2020 at 03:40:57PM -0500, Pavel Tatashin wrote: > > On Fri, Dec 11, 2020 at 3:23 PM Jason Gunthorpe wrote: > > > > > > On Fri, Dec 11, 2020 at 03:21:39PM -0500, Pavel Tatashin wrote: > > > > @@ -1593,7 +1592,7 @@ static

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-11 Thread Jason Gunthorpe
On Fri, Dec 11, 2020 at 03:40:57PM -0500, Pavel Tatashin wrote: > On Fri, Dec 11, 2020 at 3:23 PM Jason Gunthorpe wrote: > > > > On Fri, Dec 11, 2020 at 03:21:39PM -0500, Pavel Tatashin wrote: > > > @@ -1593,7 +1592,7 @@ static long check_and_migrate_cma_pages(struct > > > mm_struct *mm, > > >

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-11 Thread Pavel Tatashin
On Fri, Dec 11, 2020 at 3:23 PM Jason Gunthorpe wrote: > > On Fri, Dec 11, 2020 at 03:21:39PM -0500, Pavel Tatashin wrote: > > @@ -1593,7 +1592,7 @@ static long check_and_migrate_cma_pages(struct > > mm_struct *mm, > > } > > > > if

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-11 Thread Jason Gunthorpe
On Fri, Dec 11, 2020 at 03:21:39PM -0500, Pavel Tatashin wrote: > @@ -1593,7 +1592,7 @@ static long check_and_migrate_cma_pages(struct > mm_struct *mm, > } > > if (!isolate_lru_page(head)) { > -

[PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-11 Thread Pavel Tatashin
We should not pin pages in ZONE_MOVABLE. Currently, we do not pin only movable CMA pages. Generalize the function that migrates CMA pages to migrate all movable pages. Use is_pinnable_page() to check which pages need to be migrated Signed-off-by: Pavel Tatashin Reviewed-by: John Hubbard ---