linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Muchun Song <muchun.song@linux.dev>
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Muchun Song <songmuchun@bytedance.com>,
	Linux MM <linux-mm@kvack.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 08/10] hugetlb: remove unneeded SetHPageVmemmapOptimized()
Date: Sat, 27 Aug 2022 10:56:40 +0800	[thread overview]
Message-ID: <767650F7-25B2-4E14-B47C-C103500D31B9@linux.dev> (raw)
In-Reply-To: <e367da7d-7964-7531-3dcb-0ad7964ffdaa@huawei.com>



> On Aug 27, 2022, at 10:18, Miaohe Lin <linmiaohe@huawei.com> wrote:
> 
> On 2022/8/27 9:35, Muchun Song wrote:
>> 
>> 
>>> On Aug 26, 2022, at 17:24, Miaohe Lin <linmiaohe@huawei.com> wrote:
>>> 
>>> If code reaches here, it's guaranteed that HPageVmemmapOptimized is set
>>> for the hugetlb page (or VM_BUG_ON_PAGE() will complain about it). It's
>> 
>> Hi Miaohe,
>> 
>> Right.
>> 
>>> unnecessary to set it again.
>> 
>> No, I suppose you didn’t test this patch since it does not work. The
>> HPageVmemmapOptimized is cleared in the above code of line
>> (set_page_private(page, 0)). So NAck.
> 
> Sorry, I missed that and thanks for pointing this out. Does this code deserves a
> comment like below?
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index d0617d64d718..3374c1d2b52e 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1522,6 +1522,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);

I’m fine with this comment.

Reviewed-by: Muchun Song <songmuchun@bytedance.com>


> 
>        /*
> 
> 
> Thanks,
> Miaohe Lin



  reply	other threads:[~2022-08-27  2:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26  9:24 [PATCH 00/10] A few cleanup patches for hugetlb Miaohe Lin
2022-08-26  9:24 ` [PATCH 01/10] hugetlb: make hugetlb_cma_check() static Miaohe Lin
2022-08-27  1:40   ` Muchun Song
2022-08-26  9:24 ` [PATCH 02/10] hugetlb: Use helper macro SZ_1K Miaohe Lin
2022-08-27  1:40   ` Muchun Song
2022-08-26  9:24 ` [PATCH 03/10] hugetlb: Use LIST_HEAD() to define a list head Miaohe Lin
2022-08-27  1:47   ` Muchun Song
2022-08-27  2:27     ` Miaohe Lin
2022-08-27  2:48       ` Muchun Song
2022-08-27  6:38         ` Miaohe Lin
2022-08-26  9:24 ` [PATCH 04/10] hugetlb: Use sizeof() to get the array size Miaohe Lin
2022-08-27  1:43   ` Muchun Song
2022-08-26  9:24 ` [PATCH 05/10] hugetlb: Use helper {huge_pte|pmd}_lock() Miaohe Lin
2022-08-27  1:48   ` Muchun Song
2022-08-26  9:24 ` [PATCH 06/10] hugetlb: pass NULL to kobj_to_hstate() if nid is unused Miaohe Lin
2022-08-27  1:49   ` Muchun Song
2022-08-26  9:24 ` [PATCH 07/10] hugetlb: kill hugetlbfs_pagecache_page() Miaohe Lin
2022-08-27  1:52   ` Muchun Song
2022-08-26  9:24 ` [PATCH 08/10] hugetlb: remove unneeded SetHPageVmemmapOptimized() Miaohe Lin
2022-08-27  1:35   ` Muchun Song
2022-08-27  2:18     ` Miaohe Lin
2022-08-27  2:56       ` Muchun Song [this message]
2022-08-26  9:24 ` [PATCH 09/10] hugetlb: remove meaningless BUG_ON(huge_pte_none()) Miaohe Lin
2022-08-27  2:03   ` Muchun Song
2022-08-26  9:24 ` [PATCH 10/10] hugetlb: make hugetlb selects SYSFS if !SYSCTL Miaohe Lin
2022-08-27  1:59   ` Muchun Song
2022-08-27  2:34     ` Miaohe Lin

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=767650F7-25B2-4E14-B47C-C103500D31B9@linux.dev \
    --to=muchun.song@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=songmuchun@bytedance.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