On Tue 25-09-18 14:51:53, Kirill A. Shutemov wrote: > On Tue, Sep 25, 2018 at 12:55:33PM +0530, Ashish Mhetre wrote: > > TRANSHUGE pages have no migration support. > > Transparent pages have migration support since v4.14. This is true but not for all architectures AFAICS. In fact git grep suggests that only x86 supports the migration. So unless I am missing something the patch has some merit. But the implementation is simply wrong. If anything it should be something like diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 76f8db0b0e71..2aff77966d92 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -297,7 +297,14 @@ struct vm_area_struct; #define GFP_DMA32 __GFP_DMA32 #define GFP_HIGHUSER (GFP_USER | __GFP_HIGHMEM) #define GFP_HIGHUSER_MOVABLE (GFP_HIGHUSER | __GFP_MOVABLE) -#define GFP_TRANSHUGE_LIGHT ((GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ + +#ifdef CONFIG_ARCH_ENABLE_THP_MIGRATION +#define GFP_TRANSHUGE_MOVABLE __GFP_MOVABLE +#else +#define GFP_TRANSHUGE_MOVABLE 0 +#endif + +#define GFP_TRANSHUGE_LIGHT ((GFP_HIGHUSER |GFP_TRANSHUGE_MOVABLE | __GFP_COMP | \ __GFP_NOMEMALLOC | __GFP_NOWARN) & ~__GFP_RECLAIM) #define GFP_TRANSHUGE (GFP_TRANSHUGE_LIGHT | __GFP_DIRECT_RECLAIM) -- Michal Hocko SUSE Labs