linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/hugetlb: remove duplicate codes of setting compound_nr
@ 2021-02-03  4:40 yanfei.xu
  2021-02-03  5:24 ` Mike Kravetz
  2021-02-03  5:24 ` Xu, Yanfei
  0 siblings, 2 replies; 3+ messages in thread
From: yanfei.xu @ 2021-02-03  4:40 UTC (permalink / raw)
  To: mike.kravetz, akpm; +Cc: linux-mm, linux-kernel

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;
 	__ClearPageHead(page);
 }
 
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/hugetlb: remove duplicate codes of setting compound_nr
  2021-02-03  4:40 [PATCH] mm/hugetlb: remove duplicate codes of setting compound_nr yanfei.xu
@ 2021-02-03  5:24 ` Mike Kravetz
  2021-02-03  5:24 ` Xu, Yanfei
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Kravetz @ 2021-02-03  5:24 UTC (permalink / raw)
  To: yanfei.xu, akpm; +Cc: linux-mm, linux-kernel

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);
>  }
>  
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/hugetlb: remove duplicate codes of setting compound_nr
  2021-02-03  4:40 [PATCH] mm/hugetlb: remove duplicate codes of setting compound_nr yanfei.xu
  2021-02-03  5:24 ` Mike Kravetz
@ 2021-02-03  5:24 ` Xu, Yanfei
  1 sibling, 0 replies; 3+ messages in thread
From: Xu, Yanfei @ 2021-02-03  5:24 UTC (permalink / raw)
  To: mike.kravetz, akpm; +Cc: linux-mm, linux-kernel

Sorry. Please ignore this patch, it's incorrect.

Thanks,
Yanfei

On 2/3/21 12: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;
>   	__ClearPageHead(page);
>   }
>   
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-03  5:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03  4:40 [PATCH] mm/hugetlb: remove duplicate codes of setting compound_nr yanfei.xu
2021-02-03  5:24 ` Mike Kravetz
2021-02-03  5:24 ` Xu, Yanfei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).