[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8f0c2bd7-5fc7-6f22-3f68-21bf235ce930@oracle.com>
Date: Tue, 2 Feb 2021 21:24:03 -0800
From: Mike Kravetz <mike.kravetz@...cle.com>
To: yanfei.xu@...driver.com, akpm@...ux-foundation.org
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/hugetlb: remove duplicate codes of setting compound_nr
On 2/2/21 8:40 PM, yanfei.xu@...driver.com wrote:
> From: Yanfei Xu <yanfei.xu@...driver.com>
>
> set_compound_order() set both of page's compound_order and
> compound_nr. It's no need to assign to compound_nr again, so
> remove it.
>
> Signed-off-by: Yanfei Xu <yanfei.xu@...driver.com>
> ---
> mm/hugetlb.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index a3e4fa2c5e94..ac249b1583de 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1228,7 +1228,6 @@ static void destroy_compound_gigantic_page(struct page *page,
> }
>
> set_compound_order(page, 0);
> - page[1].compound_nr = 0;
I may be reading the code wrong, but set_compound_order(page, 0) will
set page[1].compound_nr to the value of 1. That is different than the
explicit setting to 0 in the existing code.
If that is correct, then you should say why the explicit assignment
is not necessary.
--
Mike Kravetz
> __ClearPageHead(page);
> }
>
>
Powered by blists - more mailing lists