[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YrufN8Zp8J20Qat3@monkey>
Date: Tue, 28 Jun 2022 17:39:19 -0700
From: Mike Kravetz <mike.kravetz@...cle.com>
To: Muchun Song <songmuchun@...edance.com>
Cc: david@...hat.com, akpm@...ux-foundation.org, corbet@....net,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, duanxiongchun@...edance.com
Subject: Re: [PATCH v2 8/8] mm: hugetlb_vmemmap: use PTRS_PER_PTE instead of
PMD_SIZE / PAGE_SIZE
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@...edance.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@...cle.com>
--
Mike Kravetz
Powered by blists - more mailing lists