Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-29 Thread Oscar Salvador
On Tue, Jan 29, 2019 at 11:03:56AM +0100, David Hildenbrand wrote: > Not sure if encoding the -1 in the previous line is even better now that > we have more space > > skip = (1 << compound_order(head)) - (page - head + 1); > > Looks good to me. > > > } I would rather not do that. For me

Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-29 Thread David Hildenbrand
On 28.01.19 23:56, Andrew Morton wrote: > On Mon, 28 Jan 2019 14:53:09 -0800 Andrew Morton > wrote: > >> On Fri, 25 Jan 2019 08:58:33 +0100 Oscar Salvador wrote: >> >>> On Wed, Jan 23, 2019 at 11:33:56AM +0100, David Hildenbrand wrote: If you use {} for the else case, please also do so

Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-29 Thread Oscar Salvador
On Mon, Jan 28, 2019 at 02:56:17PM -0800, Andrew Morton wrote: > > --- > a/mm/memory_hotplug.c~mmmemory_hotplug-fix-scan_movable_pages-for-gigantic-hugepages-fix > +++ a/mm/memory_hotplug.c > @@ -1305,28 +1305,27 @@ int test_pages_in_a_zone(unsigned long s > static unsigned long

Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-28 Thread Michal Hocko
On Mon 28-01-19 14:56:17, Andrew Morton wrote: [...] > --- > a/mm/memory_hotplug.c~mmmemory_hotplug-fix-scan_movable_pages-for-gigantic-hugepages-fix > +++ a/mm/memory_hotplug.c > @@ -1305,28 +1305,27 @@ int test_pages_in_a_zone(unsigned long s > static unsigned long scan_movable_pages(unsigned

Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-28 Thread Andrew Morton
On Mon, 28 Jan 2019 14:53:09 -0800 Andrew Morton wrote: > On Fri, 25 Jan 2019 08:58:33 +0100 Oscar Salvador wrote: > > > On Wed, Jan 23, 2019 at 11:33:56AM +0100, David Hildenbrand wrote: > > > If you use {} for the else case, please also do so for the if case. > > > > Diff on top: > > > >

Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-28 Thread Andrew Morton
On Fri, 25 Jan 2019 08:58:33 +0100 Oscar Salvador wrote: > On Wed, Jan 23, 2019 at 11:33:56AM +0100, David Hildenbrand wrote: > > If you use {} for the else case, please also do so for the if case. > > Diff on top: > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index

Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-28 Thread Andrew Morton
On Tue, 22 Jan 2019 16:44:07 +0100 Oscar Salvador wrote: > This is the same sort of error we saw in [1]. I'll replace "[1]" with 17e2e7d7e1b83 ("mm, page_alloc: fix has_unmovable_pages for HugePages"). > Signed-off-by: Oscar Salvador And I'll add cc:stable.

Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-24 Thread Oscar Salvador
On Wed, Jan 23, 2019 at 11:33:56AM +0100, David Hildenbrand wrote: > If you use {} for the else case, please also do so for the if case. Diff on top: diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 25aee4f04a72..d5810e522b72 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c

Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-23 Thread David Hildenbrand
On 22.01.19 16:44, Oscar Salvador wrote: > This is the same sort of error we saw in [1]. > > Gigantic hugepages crosses several memblocks, so it can be > that the page we get in scan_movable_pages() is a page-tail > belonging to a 1G-hugepage. > If that happens, page_hstate()->size_to_hstate()

Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-23 Thread Michal Hocko
On Wed 23-01-19 11:18:42, Oscar Salvador wrote: > On Wed, Jan 23, 2019 at 10:47:17AM +0100, Michal Hocko wrote: > > So this should be probably folded into the above patch as it is > > incomplete unless I am missing something. > > Well, they are triggered from different paths. > The former error

Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-23 Thread Oscar Salvador
On Wed, Jan 23, 2019 at 10:47:17AM +0100, Michal Hocko wrote: > So this should be probably folded into the above patch as it is > incomplete unless I am missing something. Well, they are triggered from different paths. The former error was triggered in: removable_show is_mem_section_removable

Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-23 Thread Michal Hocko
On Tue 22-01-19 16:44:07, Oscar Salvador wrote: > This is the same sort of error we saw in [1]. > > Gigantic hugepages crosses several memblocks, so it can be > that the page we get in scan_movable_pages() is a page-tail > belonging to a 1G-hugepage. > If that happens,

Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-22 Thread Anthony Yznaga
On 1/22/19 7:44 AM, Oscar Salvador wrote: > This is the same sort of error we saw in [1]. > > Gigantic hugepages crosses several memblocks, so it can be > that the page we get in scan_movable_pages() is a page-tail > belonging to a 1G-hugepage. > If that happens, page_hstate()->size_to_hstate()

[PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic hugepages

2019-01-22 Thread Oscar Salvador
This is the same sort of error we saw in [1]. Gigantic hugepages crosses several memblocks, so it can be that the page we get in scan_movable_pages() is a page-tail belonging to a 1G-hugepage. If that happens, page_hstate()->size_to_hstate() will return NULL, and we will blow up in