From: Mike Kravetz <mike.kravetz@oracle.com>
To: Muchun Song <songmuchun@bytedance.com>
Cc: david@redhat.com, akpm@linux-foundation.org, corbet@lwn.net,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, duanxiongchun@bytedance.com
Subject: Re: [PATCH v2 8/8] mm: hugetlb_vmemmap: use PTRS_PER_PTE instead of PMD_SIZE / PAGE_SIZE
Date: Tue, 28 Jun 2022 17:39:19 -0700 [thread overview]
Message-ID: <YrufN8Zp8J20Qat3@monkey> (raw)
In-Reply-To: <20220628092235.91270-9-songmuchun@bytedance.com>
On 06/28/22 17:22, Muchun Song wrote:
> There is already a macro PTRS_PER_PTE to represent the number of page table
> entries, just use it.
>
> Signed-off-by: Muchun Song <songmuchun@bytedance.com>
> ---
> mm/hugetlb_vmemmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c
> index 6bbc445b1a66..65b527e1799c 100644
> --- a/mm/hugetlb_vmemmap.c
> +++ b/mm/hugetlb_vmemmap.c
> @@ -48,7 +48,7 @@ static int __split_vmemmap_huge_pmd(pmd_t *pmd, unsigned long start)
>
> pmd_populate_kernel(&init_mm, &__pmd, pgtable);
>
> - for (i = 0; i < PMD_SIZE / PAGE_SIZE; i++, addr += PAGE_SIZE) {
> + for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE) {
> pte_t entry, *pte;
> pgprot_t pgprot = PAGE_KERNEL;
>
> --
> 2.11.0
>
That certainly seems like right macro/value to use.
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
--
Mike Kravetz
prev parent reply other threads:[~2022-06-29 0:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 9:22 [PATCH v2 0/8] Simplify hugetlb vmemmap and improve its readability Muchun Song
2022-06-28 9:22 ` [PATCH v2 1/8] mm: hugetlb_vmemmap: delete hugetlb_optimize_vmemmap_enabled() Muchun Song
2022-06-28 9:22 ` [PATCH v2 2/8] mm: hugetlb_vmemmap: optimize vmemmap_optimize_mode handling Muchun Song
2022-06-28 9:22 ` [PATCH v2 3/8] mm: hugetlb_vmemmap: introduce the name HVO Muchun Song
2022-06-28 9:22 ` [PATCH v2 4/8] mm: hugetlb_vmemmap: move vmemmap code related to HugeTLB to hugetlb_vmemmap.c Muchun Song
2022-06-28 9:22 ` [PATCH v2 5/8] mm: hugetlb_vmemmap: replace early_param() with core_param() Muchun Song
2022-06-28 9:22 ` [PATCH v2 6/8] mm: hugetlb_vmemmap: improve hugetlb_vmemmap code readability Muchun Song
2022-06-29 0:23 ` Mike Kravetz
2022-06-29 5:55 ` Muchun Song
2022-06-28 9:22 ` [PATCH v2 7/8] mm: hugetlb_vmemmap: move code comments to vmemmap_dedup.rst Muchun Song
2022-06-28 9:22 ` [PATCH v2 8/8] mm: hugetlb_vmemmap: use PTRS_PER_PTE instead of PMD_SIZE / PAGE_SIZE Muchun Song
2022-06-29 0:39 ` Mike Kravetz [this message]
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=YrufN8Zp8J20Qat3@monkey \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=david@redhat.com \
--cc=duanxiongchun@bytedance.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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;
as well as URLs for NNTP newsgroup(s).