From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Gavin Shan <gshan@redhat.com>, linux-arm-kernel@lists.infradead.org
Cc: catalin.marinas@arm.com, will@kernel.org,
linux-kernel@vger.kernel.org, shan.gavin@gmail.com
Subject: Re: [PATCH v2 2/3] arm64/mm: Unitify CONT_PTE_SHIFT
Date: Fri, 11 Sep 2020 12:30:31 +0530 [thread overview]
Message-ID: <f2093b0e-88eb-5afc-2452-8a06db593b14@arm.com> (raw)
In-Reply-To: <20200910095936.20307-2-gshan@redhat.com>
On 09/10/2020 03:29 PM, Gavin Shan wrote:
> CONT_PTE_SHIFT actually depends on CONFIG_ARM64_CONT_SHIFT. It's
> reasonable to reflect the dependency:
Also always better to avoid direct numerical such as 5, 7, 4. A config
option with a right name (even with constant values), gives them some
meaning.
>
> * This renames CONFIG_ARM64_CONT_SHIFT to CONFIG_ARM64_CONT_PTE_SHIFT,
> so that we can introduce CONFIG_ARM64_CONT_PMD_SHIFT later.
Agreed.
>
> * CONT_{SHIFT, SIZE, MASK}, defined in page-def.h are removed as they
> are not used by anyone.
Makes sense.
>
> * CONT_PTE_SHIFT is determined by CONFIG_ARM64_CONT_PTE_SHIFT.
>
> Signed-off-by: Gavin Shan <gshan@redhat.com>
> ---
> arch/arm64/Kconfig | 2 +-
> arch/arm64/include/asm/page-def.h | 5 -----
> arch/arm64/include/asm/pgtable-hwdef.h | 4 +---
> 3 files changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 6d232837cbee..7ec30dd56300 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -211,7 +211,7 @@ config ARM64_PAGE_SHIFT
> default 14 if ARM64_16K_PAGES
> default 12
>
> -config ARM64_CONT_SHIFT
> +config ARM64_CONT_PTE_SHIFT
> int
> default 5 if ARM64_64K_PAGES
> default 7 if ARM64_16K_PAGES
> diff --git a/arch/arm64/include/asm/page-def.h b/arch/arm64/include/asm/page-def.h
> index f99d48ecbeef..2403f7b4cdbf 100644
> --- a/arch/arm64/include/asm/page-def.h
> +++ b/arch/arm64/include/asm/page-def.h
> @@ -11,13 +11,8 @@
> #include <linux/const.h>
>
> /* PAGE_SHIFT determines the page size */
> -/* CONT_SHIFT determines the number of pages which can be tracked together */
This does not get added back in <pgtable-hwdef.h>, would you please
add one comment, for both CONT_PTE_SHIFT and CONT_PMD_SHIFT in their
respective patches.
> #define PAGE_SHIFT CONFIG_ARM64_PAGE_SHIFT
> -#define CONT_SHIFT CONFIG_ARM64_CONT_SHIFT
> #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
> #define PAGE_MASK (~(PAGE_SIZE-1))
>
> -#define CONT_SIZE (_AC(1, UL) << (CONT_SHIFT + PAGE_SHIFT))
> -#define CONT_MASK (~(CONT_SIZE-1))
> -
> #endif /* __ASM_PAGE_DEF_H */
> diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
> index 8a399e666837..6c9c67f62551 100644
> --- a/arch/arm64/include/asm/pgtable-hwdef.h
> +++ b/arch/arm64/include/asm/pgtable-hwdef.h
> @@ -81,14 +81,12 @@
> /*
> * Contiguous page definitions.
> */
> +#define CONT_PTE_SHIFT (CONFIG_ARM64_CONT_PTE_SHIFT + PAGE_SHIFT)
> #ifdef CONFIG_ARM64_64K_PAGES
> -#define CONT_PTE_SHIFT (5 + PAGE_SHIFT)
> #define CONT_PMD_SHIFT (5 + PMD_SHIFT)
> #elif defined(CONFIG_ARM64_16K_PAGES)
> -#define CONT_PTE_SHIFT (7 + PAGE_SHIFT)
> #define CONT_PMD_SHIFT (5 + PMD_SHIFT)
> #else
> -#define CONT_PTE_SHIFT (4 + PAGE_SHIFT)
> #define CONT_PMD_SHIFT (4 + PMD_SHIFT)
> #endif
>
>
Looks good to me and there are no obvious regressions as well.
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-09-11 7:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-10 9:59 [PATCH v2 1/3] arm64/mm: Remove CONT_RANGE_OFFSET Gavin Shan
2020-09-10 9:59 ` [PATCH v2 2/3] arm64/mm: Unitify CONT_PTE_SHIFT Gavin Shan
2020-09-11 7:00 ` Anshuman Khandual [this message]
2020-09-11 15:30 ` Catalin Marinas
2020-09-10 9:59 ` [PATCH v2 3/3] arm64/mm: Unitify CONT_PMD_SHIFT Gavin Shan
2020-09-11 7:05 ` Anshuman Khandual
2020-09-11 15:30 ` Catalin Marinas
2020-09-11 15:28 ` [PATCH v2 1/3] arm64/mm: Remove CONT_RANGE_OFFSET Catalin Marinas
2020-09-11 16:33 ` Will Deacon
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=f2093b0e-88eb-5afc-2452-8a06db593b14@arm.com \
--to=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=gshan@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shan.gavin@gmail.com \
--cc=will@kernel.org \
/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).