Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Michal Hocko
On Thu 23-08-18 10:56:30, Mike Kravetz wrote: > On 08/23/2018 10:01 AM, Mike Kravetz wrote: > > On 08/23/2018 05:48 AM, Michal Hocko wrote: > >> On Tue 21-08-18 18:10:42, Mike Kravetz wrote: > >> [...] > >> > >> OK, after burning myself when trying to be clever here it seems like > >> your

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Michal Hocko
On Thu 23-08-18 10:56:30, Mike Kravetz wrote: > On 08/23/2018 10:01 AM, Mike Kravetz wrote: > > On 08/23/2018 05:48 AM, Michal Hocko wrote: > >> On Tue 21-08-18 18:10:42, Mike Kravetz wrote: > >> [...] > >> > >> OK, after burning myself when trying to be clever here it seems like > >> your

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Mike Kravetz
On 08/23/2018 10:01 AM, Mike Kravetz wrote: > On 08/23/2018 05:48 AM, Michal Hocko wrote: >> On Tue 21-08-18 18:10:42, Mike Kravetz wrote: >> [...] >> >> OK, after burning myself when trying to be clever here it seems like >> your proposed solution is indeed simpler. >> >>> +bool

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Mike Kravetz
On 08/23/2018 10:01 AM, Mike Kravetz wrote: > On 08/23/2018 05:48 AM, Michal Hocko wrote: >> On Tue 21-08-18 18:10:42, Mike Kravetz wrote: >> [...] >> >> OK, after burning myself when trying to be clever here it seems like >> your proposed solution is indeed simpler. >> >>> +bool

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Mike Kravetz
On 08/23/2018 05:48 AM, Michal Hocko wrote: > On Tue 21-08-18 18:10:42, Mike Kravetz wrote: > [...] > > OK, after burning myself when trying to be clever here it seems like > your proposed solution is indeed simpler. > >> +bool huge_pmd_sharing_possible(struct vm_area_struct *vma, >> +

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Mike Kravetz
On 08/23/2018 05:48 AM, Michal Hocko wrote: > On Tue 21-08-18 18:10:42, Mike Kravetz wrote: > [...] > > OK, after burning myself when trying to be clever here it seems like > your proposed solution is indeed simpler. > >> +bool huge_pmd_sharing_possible(struct vm_area_struct *vma, >> +

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Mike Kravetz
On 08/23/2018 01:21 AM, Kirill A. Shutemov wrote: > On Thu, Aug 23, 2018 at 09:30:35AM +0200, Michal Hocko wrote: >> On Wed 22-08-18 09:48:16, Mike Kravetz wrote: >>> On 08/22/2018 05:28 AM, Michal Hocko wrote: On Tue 21-08-18 18:10:42, Mike Kravetz wrote: [...] > diff --git

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Mike Kravetz
On 08/23/2018 01:21 AM, Kirill A. Shutemov wrote: > On Thu, Aug 23, 2018 at 09:30:35AM +0200, Michal Hocko wrote: >> On Wed 22-08-18 09:48:16, Mike Kravetz wrote: >>> On 08/22/2018 05:28 AM, Michal Hocko wrote: On Tue 21-08-18 18:10:42, Mike Kravetz wrote: [...] > diff --git

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Michal Hocko
On Tue 21-08-18 18:10:42, Mike Kravetz wrote: [...] OK, after burning myself when trying to be clever here it seems like your proposed solution is indeed simpler. > +bool huge_pmd_sharing_possible(struct vm_area_struct *vma, > + unsigned long *start, unsigned long

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Michal Hocko
On Tue 21-08-18 18:10:42, Mike Kravetz wrote: [...] OK, after burning myself when trying to be clever here it seems like your proposed solution is indeed simpler. > +bool huge_pmd_sharing_possible(struct vm_area_struct *vma, > + unsigned long *start, unsigned long

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Michal Hocko
On Thu 23-08-18 11:21:12, Kirill A. Shutemov wrote: > On Thu, Aug 23, 2018 at 09:30:35AM +0200, Michal Hocko wrote: > > On Wed 22-08-18 09:48:16, Mike Kravetz wrote: > > > On 08/22/2018 05:28 AM, Michal Hocko wrote: > > > > On Tue 21-08-18 18:10:42, Mike Kravetz wrote: > > > > [...] > > > >> diff

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Michal Hocko
On Thu 23-08-18 11:21:12, Kirill A. Shutemov wrote: > On Thu, Aug 23, 2018 at 09:30:35AM +0200, Michal Hocko wrote: > > On Wed 22-08-18 09:48:16, Mike Kravetz wrote: > > > On 08/22/2018 05:28 AM, Michal Hocko wrote: > > > > On Tue 21-08-18 18:10:42, Mike Kravetz wrote: > > > > [...] > > > >> diff

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Kirill A. Shutemov
On Thu, Aug 23, 2018 at 09:30:35AM +0200, Michal Hocko wrote: > On Wed 22-08-18 09:48:16, Mike Kravetz wrote: > > On 08/22/2018 05:28 AM, Michal Hocko wrote: > > > On Tue 21-08-18 18:10:42, Mike Kravetz wrote: > > > [...] > > >> diff --git a/mm/rmap.c b/mm/rmap.c > > >> index

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Kirill A. Shutemov
On Thu, Aug 23, 2018 at 09:30:35AM +0200, Michal Hocko wrote: > On Wed 22-08-18 09:48:16, Mike Kravetz wrote: > > On 08/22/2018 05:28 AM, Michal Hocko wrote: > > > On Tue 21-08-18 18:10:42, Mike Kravetz wrote: > > > [...] > > >> diff --git a/mm/rmap.c b/mm/rmap.c > > >> index

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Michal Hocko
On Wed 22-08-18 09:48:16, Mike Kravetz wrote: > On 08/22/2018 05:28 AM, Michal Hocko wrote: > > On Tue 21-08-18 18:10:42, Mike Kravetz wrote: > > [...] > >> diff --git a/mm/rmap.c b/mm/rmap.c > >> index eb477809a5c0..8cf853a4b093 100644 > >> --- a/mm/rmap.c > >> +++ b/mm/rmap.c > >> @@ -1362,11

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-23 Thread Michal Hocko
On Wed 22-08-18 09:48:16, Mike Kravetz wrote: > On 08/22/2018 05:28 AM, Michal Hocko wrote: > > On Tue 21-08-18 18:10:42, Mike Kravetz wrote: > > [...] > >> diff --git a/mm/rmap.c b/mm/rmap.c > >> index eb477809a5c0..8cf853a4b093 100644 > >> --- a/mm/rmap.c > >> +++ b/mm/rmap.c > >> @@ -1362,11

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-22 Thread Mike Kravetz
On 08/22/2018 02:05 PM, Kirill A. Shutemov wrote: > On Tue, Aug 21, 2018 at 06:10:42PM -0700, Mike Kravetz wrote: >> diff --git a/mm/hugetlb.c b/mm/hugetlb.c >> index 3103099f64fd..f085019a4724 100644 >> --- a/mm/hugetlb.c >> +++ b/mm/hugetlb.c >> @@ -4555,6 +4555,9 @@ static bool

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-22 Thread Mike Kravetz
On 08/22/2018 02:05 PM, Kirill A. Shutemov wrote: > On Tue, Aug 21, 2018 at 06:10:42PM -0700, Mike Kravetz wrote: >> diff --git a/mm/hugetlb.c b/mm/hugetlb.c >> index 3103099f64fd..f085019a4724 100644 >> --- a/mm/hugetlb.c >> +++ b/mm/hugetlb.c >> @@ -4555,6 +4555,9 @@ static bool

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-22 Thread Kirill A. Shutemov
On Tue, Aug 21, 2018 at 06:10:42PM -0700, Mike Kravetz wrote: > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 3103099f64fd..f085019a4724 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -4555,6 +4555,9 @@ static bool vma_shareable(struct vm_area_struct *vma, > unsigned long addr) > >

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-22 Thread Kirill A. Shutemov
On Tue, Aug 21, 2018 at 06:10:42PM -0700, Mike Kravetz wrote: > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 3103099f64fd..f085019a4724 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -4555,6 +4555,9 @@ static bool vma_shareable(struct vm_area_struct *vma, > unsigned long addr) > >

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-22 Thread Mike Kravetz
On 08/22/2018 05:28 AM, Michal Hocko wrote: > On Tue 21-08-18 18:10:42, Mike Kravetz wrote: > [...] >> diff --git a/mm/rmap.c b/mm/rmap.c >> index eb477809a5c0..8cf853a4b093 100644 >> --- a/mm/rmap.c >> +++ b/mm/rmap.c >> @@ -1362,11 +1362,21 @@ static bool try_to_unmap_one(struct page *page, >>

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-22 Thread Mike Kravetz
On 08/22/2018 05:28 AM, Michal Hocko wrote: > On Tue 21-08-18 18:10:42, Mike Kravetz wrote: > [...] >> diff --git a/mm/rmap.c b/mm/rmap.c >> index eb477809a5c0..8cf853a4b093 100644 >> --- a/mm/rmap.c >> +++ b/mm/rmap.c >> @@ -1362,11 +1362,21 @@ static bool try_to_unmap_one(struct page *page, >>

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-22 Thread Michal Hocko
On Tue 21-08-18 18:10:42, Mike Kravetz wrote: [...] > diff --git a/mm/rmap.c b/mm/rmap.c > index eb477809a5c0..8cf853a4b093 100644 > --- a/mm/rmap.c > +++ b/mm/rmap.c > @@ -1362,11 +1362,21 @@ static bool try_to_unmap_one(struct page *page, > struct vm_area_struct *vma, > } > > /* >

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-22 Thread Michal Hocko
On Tue 21-08-18 18:10:42, Mike Kravetz wrote: [...] > diff --git a/mm/rmap.c b/mm/rmap.c > index eb477809a5c0..8cf853a4b093 100644 > --- a/mm/rmap.c > +++ b/mm/rmap.c > @@ -1362,11 +1362,21 @@ static bool try_to_unmap_one(struct page *page, > struct vm_area_struct *vma, > } > > /* >

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-21 Thread Mike Kravetz
On 08/21/2018 05:51 PM, kbuild test robot wrote: > Hi Mike, > > I love your patch! Yet something to improve: > > [auto build test ERROR on linus/master] > [also build test ERROR on v4.18 next-20180821] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-21 Thread Mike Kravetz
On 08/21/2018 05:51 PM, kbuild test robot wrote: > Hi Mike, > > I love your patch! Yet something to improve: > > [auto build test ERROR on linus/master] > [also build test ERROR on v4.18 next-20180821] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-21 Thread kbuild test robot
Hi Mike, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.18 next-20180821] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-21 Thread kbuild test robot
Hi Mike, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.18 next-20180821] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-21 Thread Mike Kravetz
On 08/21/2018 03:03 PM, kbuild test robot wrote: > Hi Mike, > > I love your patch! Yet something to improve: > > [auto build test ERROR on linus/master] > [also build test ERROR on v4.18 next-20180821] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-21 Thread Mike Kravetz
On 08/21/2018 03:03 PM, kbuild test robot wrote: > Hi Mike, > > I love your patch! Yet something to improve: > > [auto build test ERROR on linus/master] > [also build test ERROR on v4.18 next-20180821] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-21 Thread kbuild test robot
Hi Mike, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.18 next-20180821] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-21 Thread kbuild test robot
Hi Mike, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.18 next-20180821] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

[PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-21 Thread Mike Kravetz
The page migration code employs try_to_unmap() to try and unmap the source page. This is accomplished by using rmap_walk to find all vmas where the page is mapped. This search stops when page mapcount is zero. For shared PMD huge pages, the page map count is always 1 no matter the number of

[PATCH v3 1/2] mm: migration: fix migration of huge PMD shared pages

2018-08-21 Thread Mike Kravetz
The page migration code employs try_to_unmap() to try and unmap the source page. This is accomplished by using rmap_walk to find all vmas where the page is mapped. This search stops when page mapcount is zero. For shared PMD huge pages, the page map count is always 1 no matter the number of