From: Miaohe Lin Date: Thu, 1 Sep 2022 12:00:28 +0000 (+0800) Subject: hugetlb: add comment for subtle SetHPageVmemmapOptimized() X-Git-Tag: v6.1-rc1~68^2~424 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a9e1eab241bdaadd56b6cfdc481cff6a24c4799b;p=thirdparty%2Flinux.git hugetlb: add comment for subtle SetHPageVmemmapOptimized() The SetHPageVmemmapOptimized() called here seems unnecessary as it's assumed to be set when calling this function. But it's indeed cleared by above set_page_private(page, 0). Add a comment to avoid possible future confusion. Link: https://lkml.kernel.org/r/20220901120030.63318-9-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Cc: Mike Kravetz Signed-off-by: Andrew Morton --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 29c3478d1bf37..fe7b69a970aa7 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1504,6 +1504,10 @@ static void add_hugetlb_page(struct hstate *h, struct page *page, set_compound_page_dtor(page, HUGETLB_PAGE_DTOR); set_page_private(page, 0); + /* + * We have to set HPageVmemmapOptimized again as above + * set_page_private(page, 0) cleared it. + */ SetHPageVmemmapOptimized(page); /*