Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Michal Hocko
On Wed 22-11-17 10:09:13, Zi Yan wrote: > > > Michal Hocko wrote: > > On Wed 22-11-17 09:43:46, Zi Yan wrote: > >> > >> Michal Hocko wrote: [...] > >>> but why is unsafe to enable the feature on other arches which support > >>> THP? Is there any plan to do the next step and remove this config > >

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Zi Yan
Michal Hocko wrote: > On Wed 22-11-17 09:43:46, Zi Yan wrote: >> >> Michal Hocko wrote: >>> On Wed 22-11-17 09:54:16, Michal Hocko wrote: On Mon 20-11-17 21:18:55, Zi Yan wrote: >>> [...] > diff --git a/include/linux/migrate.h b/include/linux/migrate.h > index 895ec0c4942e..a2246cf67

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Michal Hocko
On Wed 22-11-17 09:43:46, Zi Yan wrote: > > > Michal Hocko wrote: > > On Wed 22-11-17 09:54:16, Michal Hocko wrote: > >> On Mon 20-11-17 21:18:55, Zi Yan wrote: > > [...] > >>> diff --git a/include/linux/migrate.h b/include/linux/migrate.h > >>> index 895ec0c4942e..a2246cf670ba 100644 > >>> --- a

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Zi Yan
Michal Hocko wrote: > On Wed 22-11-17 09:54:16, Michal Hocko wrote: >> On Mon 20-11-17 21:18:55, Zi Yan wrote: > [...] >>> diff --git a/include/linux/migrate.h b/include/linux/migrate.h >>> index 895ec0c4942e..a2246cf670ba 100644 >>> --- a/include/linux/migrate.h >>> +++ b/include/linux/migrate.h

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Michal Hocko
On Wed 22-11-17 09:54:16, Michal Hocko wrote: > On Mon 20-11-17 21:18:55, Zi Yan wrote: [...] > > diff --git a/include/linux/migrate.h b/include/linux/migrate.h > > index 895ec0c4942e..a2246cf670ba 100644 > > --- a/include/linux/migrate.h > > +++ b/include/linux/migrate.h > > @@ -54,7 +54,7 @@ stat

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Michal Hocko
On Wed 22-11-17 07:29:38, Zi Yan wrote: > On 22 Nov 2017, at 7:13, Zi Yan wrote: > > > On 22 Nov 2017, at 5:14, Michal Hocko wrote: > > > >> On Wed 22-11-17 10:35:10, Michal Hocko wrote: > >> [...] > >>> Moreover I am not really sure this is really working properly. Just look > >>> at the split_hu

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Zi Yan
On 22 Nov 2017, at 7:13, Zi Yan wrote: > On 22 Nov 2017, at 5:14, Michal Hocko wrote: > >> On Wed 22-11-17 10:35:10, Michal Hocko wrote: >> [...] >>> Moreover I am not really sure this is really working properly. Just look >>> at the split_huge_page. It moves all the tail pages to the LRU list >>>

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Zi Yan
On 22 Nov 2017, at 5:14, Michal Hocko wrote: > On Wed 22-11-17 10:35:10, Michal Hocko wrote: > [...] >> Moreover I am not really sure this is really working properly. Just look >> at the split_huge_page. It moves all the tail pages to the LRU list >> while migrate_pages has a list of pages to migr

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Michal Hocko
On Wed 22-11-17 10:35:10, Michal Hocko wrote: [...] > Moreover I am not really sure this is really working properly. Just look > at the split_huge_page. It moves all the tail pages to the LRU list > while migrate_pages has a list of pages to migrate. So we will migrate > the head page and all the r

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Andrea Reale
On Tue 21 Nov 2017, 17:35, Zi Yan wrote: > On 21 Nov 2017, at 17:12, Andrew Morton wrote: > > > On Mon, 20 Nov 2017 21:18:55 -0500 Zi Yan wrote: > > > >> This patch fixes it by only calling prep_transhuge_page() when we are > >> certain that the target page is THP. > > > > What are the user-visib

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Michal Hocko
On Wed 22-11-17 04:18:35, Zi Yan wrote: > On 22 Nov 2017, at 3:54, Michal Hocko wrote: [...] > > I would keep the two checks consistent. But that leads to a more > > interesting question. new_page_nodemask does > > > > if (thp_migration_supported() && PageTransHuge(page)) { > > orde

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Zi Yan
On 22 Nov 2017, at 3:54, Michal Hocko wrote: > On Mon 20-11-17 21:18:55, Zi Yan wrote: >> From: Zi Yan >> >> In [1], Andrea reported that during memory hotplug/hot remove >> prep_transhuge_page() is called incorrectly on non-THP pages for >> migration, when THP is on but THP migration is not enab

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Michal Hocko
On Mon 20-11-17 21:18:55, Zi Yan wrote: > From: Zi Yan > > In [1], Andrea reported that during memory hotplug/hot remove > prep_transhuge_page() is called incorrectly on non-THP pages for > migration, when THP is on but THP migration is not enabled. > This leads to a bad state of target pages for

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-21 Thread Zi Yan
On 21 Nov 2017, at 17:12, Andrew Morton wrote: > On Mon, 20 Nov 2017 21:18:55 -0500 Zi Yan wrote: > >> In [1], Andrea reported that during memory hotplug/hot remove >> prep_transhuge_page() is called incorrectly on non-THP pages for >> migration, when THP is on but THP migration is not enabled. >

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-21 Thread Andrew Morton
On Mon, 20 Nov 2017 21:18:55 -0500 Zi Yan wrote: > In [1], Andrea reported that during memory hotplug/hot remove > prep_transhuge_page() is called incorrectly on non-THP pages for > migration, when THP is on but THP migration is not enabled. > This leads to a bad state of target pages for migrati

[PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-20 Thread Zi Yan
From: Zi Yan In [1], Andrea reported that during memory hotplug/hot remove prep_transhuge_page() is called incorrectly on non-THP pages for migration, when THP is on but THP migration is not enabled. This leads to a bad state of target pages for migration. This patch fixes it by only calling pre