[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y9eYgSnTmI168933@wendy>
Date: Mon, 30 Jan 2023 10:14:25 +0000
From: Conor Dooley <conor.dooley@...rochip.com>
To: Jinyu Tang <tjytimi@....com>
CC: <palmer@...osinc.com>, <paul.walmsley@...ive.com>,
<palmer@...belt.com>, <yuzhao@...gle.com>,
<ajones@...tanamicro.com>, <guoren@...nel.org>,
<tongtiangen@...wei.com>, <anup@...infault.org>,
<akpm@...ux-foundation.org>, <falcon@...ylab.org>,
<linux-riscv@...ts.infradead.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1] riscv: support arch_has_hw_pte_young()
On Sun, Jan 29, 2023 at 02:49:56PM +0800, Jinyu Tang wrote:
> The arch_has_hw_pte_young() is false for riscv by default. If it's
> false, page table walk is almost skipped for MGLRU reclaim. And it
> will also cause useless step in __wp_page_copy_user().
>
> RISC-V Privileged Book says that riscv have two schemes to manage A
> and D bit.
>
> So add a config for selecting, the default is true. For simple
> implementation riscv CPU which just generate page fault, unselect it.
>
> Signed-off-by: Jinyu Tang <tjytimi@....com>
> ---
> arch/riscv/Kconfig | 10 ++++++++++
> arch/riscv/include/asm/pgtable.h | 7 +++++++
> 2 files changed, 17 insertions(+)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index e2b656043abf..17c82885549c 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -180,6 +180,16 @@ config PAGE_OFFSET
> default 0x80000000 if 64BIT && !MMU
> default 0xff60000000000000 if 64BIT
>
> +config ARCH_HAS_HARDWARE_PTE_YOUNG
> + bool "Hardware Set PTE Access Bit"
> + default y
> + help
> + Select if hardware set A bit when PTE is accessed. The default is
> + 'Y', because most RISC-V CPU hardware can manage A and D bit.
> + But RISC-V may have simple implementation that do not support
> + hardware set A bit but only generate page fault, for that case just
> + unselect it.
Hmm, I am not really sure if this is the right way to go. Should we
really be defaulting this option to enabled if there are going to be
implementations that do not support it?
Thanks,
Conor.
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists