Re: [PATCH v3 2/6] mm: hugetlbfs: fix cannot migrate the fallocated HugeTLB page

From: Mike Kravetz
Date: Mon Jan 11 2021 - 19:52:33 EST


On 1/10/21 4:40 AM, Muchun Song wrote:
> If a new hugetlb page is allocated during fallocate it will not be
> marked as active (set_page_huge_active) which will result in a later
> isolate_huge_page failure when the page migration code would like to
> move that page. Such a failure would be unexpected and wrong.
>
> Only export set_page_huge_active, just leave clear_page_huge_active
> as static. Because there are no external users.
>
> Fixes: 70c3547e36f5 (hugetlbfs: add hugetlbfs_fallocate())
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> ---
> fs/hugetlbfs/inode.c | 3 ++-
> include/linux/hugetlb.h | 2 ++
> mm/hugetlb.c | 2 +-
> 3 files changed, 5 insertions(+), 2 deletions(-)

Thanks.

Although page_huge_active is declared in page-flags.h, I much prefer the
declaration of set_page_huge_active to be in hugetlb.c.

Reviewed-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx>
--
Mike Kravetz