Re: [PATCH v2 2/5] hugetlb: convert page_huge_active() HPageMigratable flag

From: Oscar Salvador
Date: Thu Jan 21 2021 - 15:09:46 EST


On Wed, Jan 20, 2021 at 01:48:05PM -0800, Mike Kravetz wrote:
> >> This comment addresses both this patch and the next one.
> >>
> >> Instead of putting the SetHPageMigratable flag spread over the
> >> allocation paths, would it make more sense to place it in
> >> alloc_huge_page before returning the page?
> >> Then we could opencode SetHPageMigratableIfSupported right there.
> >
> > and in putback_active_hugepage.
>
>
> Hi Oscar,
>
> In Muchun's series of hugetlb bug fixes, Michal asked the same question.
>
> https://lore.kernel.org/linux-mm/7e69a55c-d501-6b42-8225-a677f09fb829@xxxxxxxxxx/
>
> The 'short answer' is that the this would allow a page to be migrated
> after allocation but before the page fault code adds it to the page
> cache or page tables. This actually caused bugs in the past.

Oh, I see. I jumped late into that patchset so I missed some early messages.
Thanks for explaining this again.

--
Oscar Salvador
SUSE L3