linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: yanfei.xu@windriver.com, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/hugetlb: remove duplicate codes of setting compound_nr
Date: Tue, 2 Feb 2021 21:24:03 -0800	[thread overview]
Message-ID: <8f0c2bd7-5fc7-6f22-3f68-21bf235ce930@oracle.com> (raw)
In-Reply-To: <20210203044055.89618-1-yanfei.xu@windriver.com>

On 2/2/21 8:40 PM, yanfei.xu@windriver.com wrote:
> From: Yanfei Xu <yanfei.xu@windriver.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@windriver.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);
>  }
>  
> 


  reply	other threads:[~2021-02-03  5:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03  4:40 yanfei.xu
2021-02-03  5:24 ` Mike Kravetz [this message]
2021-02-03  5:24 ` Xu, Yanfei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8f0c2bd7-5fc7-6f22-3f68-21bf235ce930@oracle.com \
    --to=mike.kravetz@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=yanfei.xu@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox