Re: Infinite looping observed in __offline_pages

From: Michal Hocko
Date: Thu Aug 23 2018 - 03:25:48 EST


On Wed 22-08-18 11:58:02, Mike Kravetz wrote:
> On 08/22/2018 02:30 AM, Aneesh Kumar K.V wrote:
[...]
> > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> > index 4eb6e824a80c..f9bdea685cf4 100644
> > --- a/mm/memory_hotplug.c
> > +++ b/mm/memory_hotplug.c
> > @@ -1338,7 +1338,8 @@ static unsigned long scan_movable_pages(unsigned long start, unsigned long end)
> > return pfn;
> > if (__PageMovable(page))
> > return pfn;
> > - if (PageHuge(page)) {
> > + if (IS_ENABLED(CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION) &&
> > + PageHuge(page)) {
>
> How about using hugepage_migration_supported instead? It would automatically
> catch those non-migratable huge page sizes. Something like:
>
> if (PageHuge(page) &&
> hugepage_migration_supported(page_hstate(page))) {

Ohh, definitely, this is much better.
--
Michal Hocko
SUSE Labs